warning: "_POSIX_C_SOURCE" redefined

David M. Cooke cookedm+news at physics.mcmaster.ca
Tue Mar 30 15:09:41 EST 2004


At some point, Marc Schellens <m_schellens at hotmail.com> wrote:

> Including Python.h I got the following warining
>
> warning: "_POSIX_C_SOURCE" redefined
>
> in Python.h:
>
> #define _POSIX_C_SOURCE 200112L
>
> in features.h (included from string):
>
> # define _POSIX_C_SOURCE	199506L
>
> Is there a (potential) problem with this?

There's no problem, but to get rid of the warning, check that
"Python.h" is the _first_ thing included (before system headers, such
as "stdio.h").

_POSIX_C_SOURCE is something that's defined by the user to tell the
runtime what version of the POSIX standard to use. From the comments
at the top of my features.h :

/* These are defined by the user (or the compiler)
   to specify the desired environment:

   __STRICT_ANSI__      ISO Standard C.
   _ISOC99_SOURCE       Extensions to ISO C89 from ISO C99.
   _POSIX_SOURCE        IEEE Std 1003.1.
   _POSIX_C_SOURCE      If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
                        if >=199309L, add IEEE Std 1003.1b-1993;
                        if >=199506L, add IEEE Std 1003.1c-1995


-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke
|cookedm(at)physics(dot)mcmaster(dot)ca



More information about the Python-list mailing list