[Python-bugs-list] [ python-Bugs-539719 ] IBM's xlc compiler needs extra option

noreply@sourceforge.net noreply@sourceforge.net
Fri, 05 Apr 2002 10:11:55 -0800


Bugs item #539719, was opened at 2002-04-05 12:21
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=539719&group_id=5470

Category: Build
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: M.-A. Lemburg (lemburg)
Assigned to: Martin v. Löwis (loewis)
Summary: IBM's xlc compiler needs extra option

Initial Comment:
An mx user complained to me about the xlc compiler
not handling forward declarations of static variables
correctly.

He found that with the added compiler option '-qlanglvl=ansi'
things work as expected. I currently don't have access to AIX,
but the option suggests that xlc then behaves in an ANSI
compatible way, which can't be that bad :-)

I'd suggest to add that option as default to Python builds,
so that all distutils based extensions automatically
pick it up for compilation (distutils reads the Python
Makefile for compiler settings).

Hope this one is right for you, Martin.


----------------------------------------------------------------------

>Comment By: M.-A. Lemburg (lemburg)
Date: 2002-04-05 18:11

Message:
Logged In: YES 
user_id=38388

Ok, I had a misunderstanding. What's really needed is not ansi, 
but extended language level, i.e. -qlanglvl=extended.

I'll add a #pragma to the mx extensions to address this.

Feel free to close the bug report.


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-04-05 17:54

Message:
Logged In: YES 
user_id=21627

I would be curious then as to why the staticforward thing
fails for you. Can you please have your user produce
preprocessor out to see what it expands to? If it does not
expand to "extern", it would be interesting to find out
whether pyconfig.h detected BAD_STATIC_FORWARD. Perhaps this
is a version of Python where Python's config.h conflicts
with  the one in your package (i.e. pre-pyconfig.h?) 

----------------------------------------------------------------------

Comment By: M.-A. Lemburg (lemburg)
Date: 2002-04-05 16:48

Message:
Logged In: YES 
user_id=38388

Thanks for the URL.

I am already using the work-around in Python's header file,
but whether you define it or not doesn't make any difference
without the langlvl setting -- both ways turn out as error
with the compiler according to the user.

I'll forward the URL to the user and see whether he can make 
something of it.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-04-05 15:24

Message:
Logged In: YES 
user_id=21627

I don't want to change this, as I don't have access to an
AIX system, either; I might consider accepting a well-tested
patch, though. However,

http://usgibm.nersc.gov/vac/ref/compopts/ruoptlvl.htm

suggests that the default langlevel is ANSI, so I don't
trust the recommendation that adding it helps. Furthermore,
I'm concerned that something else may break, since the ANSI
settings of the compilers tend to disable a lot of useful
functions (which are merely POSIX instead of being even ANSI).

For your specific problem: Python.h offers the staticforward
define, which ought to correctly use static for each each
compiler.

If you think you need a platform-specific work-around, you
can add a pragma langlvl (see URL).



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=539719&group_id=5470