[Python-Dev] Should Python compile as C++?

Gerhard Häring gh_pythonlist@gmx.de
Tue, 5 Feb 2002 10:30:55 +0100

Le 05/02/02 à 01:34, Guido van Rossum écrivit:
> > I'm currently doing a native mingw32 port of Python, and I've hit the
> > ugly "initializer is not a constant" problem mentioned in the FAQ. Hmm,
> > looks like I have three options:
> > 
> > 1 Fix the Python sources in the Object/ directory and initalize the
> >   structs in a seperate init_objects function
> > 2 compile Python with a C++ compiler
> > 3 fix the mingw32 compiler
> > 
> > [Python doesn't compile with C++ compiler]
> > 
> > Because I plan to submit the required changes as a patch when the port
> > is ready, I'd like to know if you'd accept a patch for option #1.
> Sounds to me like the Mingw32 compiler is not ANSI compatible.  I
> don't want to have to change the source to accommodate a broken
> compiler that a very small minority of users want to use.  So I am
> against #1.

I now found the reason for the compiler message. I forgot to set
USE_DL_EXPORT when compiling the Python core. Doh! Sorry for the noise.
Everything works reasonably fine now.

> We never said that our .c files would be valid C++ (.h files is a
> different story) [...]

Ok. I must have mistaken Python with a different project.

> I vote for #3 -- if enough software can't compiled with mingw32 the
> compiler will be fixed, as it should, and I'm happy to help encourage
> this.

I'm not quite sure if was really a bug in mingw32, but the fact that the
compiler accepts the code when compiled as C++ is at least inconsistent.

This sig powered by Python!
Außentemperatur in München: 10.2 °C      Wind: 3.6 m/s