This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients pablogsal
Date 2019-02-06.14:45:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549464332.95.0.70522769189.issue35912@roundup.psfhosted.org>
In-reply-to
Content
Programs/_testembed.c is compiled with $(MAINCC) in Makefile.pre.in and that will use the C++ compiler if --with-cxx-main is used in the configuration step. The problem is that if the C++ compiler used is some of the more uncommon ones (like the solaris compiler) some parts of _testembed.c and its includes fail to compile because they are assuming C99 or compiler extension. There are mainly two:

1) _testembed.c has gotos that crosses variable definitions. The C++ standard says:

If transfer of control enters the scope of any automatic variables (e.g. by jumping forward over a declaration statement), the program is ill-formed (cannot be compiled), unless all variables whose scope is entered have

1) scalar types declared without initializers
2) class types with trivial default constructors and trivial destructors declared without initializers
3) cv-qualified versions of one of the above
4) arrays of one of the above

So the gotos that can be found in `dump_config_impl` in `_testembed.c` are invalidating this rule.

2) `testembed.c` is pulling `pystate.h` and that header file defines a macro (_PyCoreConfig_INIT) that uses designated initializers that are not available as an extension in all C++ compilers.

The solutions that I can immediately think of aare:

1) Compile _testembed.c with the $(CC) instead of $(CCMAIN).
2) Change these files to make them compliant with the standard (by initializing all variables at the beginning and by using just compound literals).
History
Date User Action Args
2019-02-06 14:45:36pablogsalsetrecipients: + pablogsal
2019-02-06 14:45:32pablogsalsetmessageid: <1549464332.95.0.70522769189.issue35912@roundup.psfhosted.org>
2019-02-06 14:45:32pablogsallinkissue35912 messages
2019-02-06 14:45:32pablogsalcreate