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.

classification
Title: IBM's xlc compiler needs extra option
Type: Stage:
Components: Build Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: loewis Nosy List: lemburg, loewis
Priority: normal Keywords:

Created on 2002-04-05 12:21 by lemburg, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Messages (6)
msg10174 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2002-04-05 12:21
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.
msg10175 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-04-05 15:24
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).

msg10176 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2002-04-05 16:48
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.
msg10177 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-04-05 17:54
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?) 
msg10178 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2002-04-05 18:11
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.
msg10179 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-04-05 18:58
Logged In: YES 
user_id=21627

Ok, closing it.

I'm still confused as to why you need to adjust your code,
whereas the Python distribution, which uses the same
construct all over the place, apparently compiles successfully.
History
Date User Action Args
2022-04-10 16:05:11adminsetgithub: 36386
2002-04-05 12:21:23lemburgcreate