[issue1759169] clean up Solaris port and allow C99 extension modules

Martin v. Löwis report at bugs.python.org
Mon Feb 16 22:45:35 CET 2009


Martin v. Löwis <martin at v.loewis.de> added the comment:

> Theoretically: yes, it's wrong for Python to claim that all extensions
> are compliant to a particular XPG environment.

It's somewhat unfortunate that Python makes such claims for extensions;
primarily, these macros are defined for the compilation of Python
itself. It would be possible to suppress them when compiling non-core
extensions.

However, experience tells that systems can break in surprising ways
if the system headers are compiled with different defines. On some
systems, the sizes and layouts of some types change under such macros,
causing crashes when the extension sees a different size or layout than
the Python core.

> If it helps, Martin, I can put you in touch with our standards expert.
> I'm far from such, so this might help assuage your doubts?

I do feel this restrictiveness of the header files (wrt. C99) is
arbitrary, and has no use. I think system vendors often interpret
"feature selection macro" in a different way than it should be
interpreted (i.e. instead of "make sure any program complying with
the selected features compiles fine", the macros are interpreted
as "reject any program that uses features beyond the selected ones").

So if there is a chance that Sun might reconsider this specific design
choice, I'd love to talk with somebody - setting _XOPEN_SOURCE had
worked fine since Solaris 7.

Independent of such a discussion, I can grudgingly accept removal
of _XOPEN_SOURCE on Solaris 5.{9,10,11} (?), to work-around this
system limitation.

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1759169>
_______________________________________


More information about the Python-bugs-list mailing list