classification
Title: Failure to compile trunk on Solaris10/SPARC using C++ compiler
Type: Stage:
Components: Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, loewis, skip.montanaro
Priority: normal Keywords:

Created on 2008-12-14 21:16 by skip.montanaro, last changed 2008-12-15 16:27 by loewis. This issue is now closed.

Messages (7)
msg77828 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2008-12-14 21:16
I don't know if the Python source is supposed to be compilable with a C++
compiler or not, but I'm having trouble finding a C compiler on the
Solaris10/SPARC machines at work.  I decided to give a C++ compiler a whirl:

    /opt/gnu/bin/c++ -c -fno-strict-aliasing -DNDEBUG -g  -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I../Include   -DPy_BUILD_CORE -o Parser/tokenizer.o ../Parser/tokenizer.c
    ../Parser/tokenizer.c: In function `char * PyTokenizer_RestoreEncoding(tok_state *, int, int *)':
    ../Parser/tokenizer.c:1614: ANSI C++ forbids implicit conversion from `void *' in assignment

Now this turns out to be a very old compiler:

    % /opt/gnu/bin/c++ --version
    2.95.3

Should Python be able to compile with this ancient GNU C++ compiler?

Thx,

Skip
msg77829 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-12-14 21:20
Python should be compile-able with a C++ compiler. I'll test it on my
system in a couple of minutes.
msg77833 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-12-14 21:29
The trunk contains lots of implicit casts from void pointers that make
the code incompatible with C++.
msg77835 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-12-14 21:31
I disagree. It's not a requirement that the Python source code is
compilable as C++. Only the header files should be thus compilable.
msg77836 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-12-14 21:36
Ah, I was under the impression that Python must be compatible both C++
and C89 compilers.

Do we have any means to test the C++ compatibility of the header files?
Full C++ compatibility is one way to make sure the header files are
compatible, too. *wink* I don't see harm in sprinkling explicit type
casts over the C code, too.
msg77838 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-12-14 21:48
> Do we have any means to test the C++ compatibility of the header files?

No, we fix it when users report bugs (which typically happens very
quickly after we made some).

> Full C++ compatibility is one way to make sure the header files are
> compatible, too. *wink* I don't see harm in sprinkling explicit type
> casts over the C code, too.

That requires discussion, I'm opposed to such a change: it adds
unnecessary complication. In any case, such discussion would belong
to python-dev.
msg77874 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-12-15 16:27
Closing as "won't fix" for now.
History
Date User Action Args
2008-12-15 16:27:33loewissetstatus: open -> closed
resolution: wont fix
messages: + msg77874
2008-12-14 21:48:47loewissetmessages: + msg77838
2008-12-14 21:36:33christian.heimessetmessages: + msg77836
2008-12-14 21:31:36loewissetnosy: + loewis
messages: + msg77835
2008-12-14 21:29:56christian.heimessetmessages: + msg77833
2008-12-14 21:20:48christian.heimessetnosy: + christian.heimes
messages: + msg77829
2008-12-14 21:16:32skip.montanarocreate