[Python-Dev] Make _GNU_SOURCE default for gcc ?!
M.-A. Lemburg
mal@lemburg.com
Tue, 04 Jul 2000 12:43:23 +0200
Fredrik Lundh wrote:
>
> mal wrote:
> > There was a discussion about adding a #define _XOPEN_SOURCE
> > to the standard header files in Python (among other things to
> > fix the warning in the timemodule.c on Linux).
> >
> > What happened to that idea ?
> >
> > I think it would be worthwhile to add a
> >
> > #ifdef __GNUC__
> > # define _GNU_SOURCE
> > #endif
> >
> > to Python.h. This enables all features available for the
> > gcc compiler including _XOPEN_SOURCE and fixes warnings
> > related to missing prototypes.
> >
> > Thoughts ? Would this hurt anybody ?
>
> what does "fixes warnings" mean? does it change the compiler's
> behaviour, or does it just make sure stuff are defined in the right
> files?
AFAIK, it only makes certain APIs available as prototype.
Without the prototypes the usual response from the compiler
are warning such as "converted integer to pointer without
a cast" and somesuch (the default return value being "int").
> how is this different from just a plain (and truly portable)
> #define _XOPEN_SOURCE?
_XOPEN_SOURCE would also cure the warning in timemodule.
> (the only concern I see here is that people on Linux platforms
> might start churning out code that depends on certain gcc-only
> features, without noticing...)
>
> +1 on _XOPEN_SOURCE
> +0 on _GNU_SOURCE
Ok, so how about adding
#define _XOPEN_SOURCE
to Python.h ?
--
Marc-Andre Lemburg
______________________________________________________________________
Business: http://www.lemburg.com/
Python Pages: http://www.lemburg.com/python/