Graham,
Well what _POSIX_C_SOURCE and _XOPEN_SOURCE are set to in features.h
is not very straight forward. This is what I found in the header docs:
_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;
if >=200112L, all of IEEE 1003.1-2004
if >=200809L, all of IEEE 1003.1-2008
_XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if
Single Unix conformance is wanted, to 600 for the
sixth revision, to 700 for the seventh revision.
/usr/include/python2.6/pyconfig.h:
/* Define to activate features from IEEE Stds 1003.1-2001 */
#define _POSIX_C_SOURCE 200112L
/* Define to the level of X/Open that your system supports */
#define _XOPEN_SOURCE 600
-------------------
It looks like _XOPEN_SOURCE is being set to 700 and _POSIX_C_SOURCE
200809L in features.h. I'm assuming that _GNU_SOURCE is defined since
this is an Ubuntu server running on two Xion hyper-treading 32bit
processors which data back to about 2004. It looks like from the order
of the error message that the Python definition are winning out with
slightly older features assuming the compiler is actually allowing the
redefinition of these defs. Well mod_wsgi seems to be working fine, so
I'm not really worried about this. I have a stock binary install of
Python, so the Python sources are just used to build mod_wsgi.
/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
#ifdef _GNU_SOURCE
# undef _ISOC99_SOURCE
# define _ISOC99_SOURCE 1
# undef _POSIX_SOURCE
# define _POSIX_SOURCE 1
# undef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 200809L
# undef _XOPEN_SOURCE
# define _XOPEN_SOURCE 700
# undef _XOPEN_SOURCE_EXTENDED
# define _XOPEN_SOURCE_EXTENDED 1
# undef _LARGEFILE64_SOURCE
# define _LARGEFILE64_SOURCE 1
# undef _BSD_SOURCE
# define _BSD_SOURCE 1
# undef _SVID_SOURCE
# define _SVID_SOURCE 1
# undef _ATFILE_SOURCE
# define _ATFILE_SOURCE 1
#endif
~Carl
On Tue, Oct 19, 2010 at 7:25 AM, Graham Dumpleton
<[email protected]> wrote:
> On 13 October 2010 05:38, Carl Nobile <[email protected]> wrote:
>> Graham, I realize this is not a big issue, but I have noticed compiler
>> warning while compiling the latest trunk revision 1703. You usually
>> have pristine compiles, so it caught my attention.
>>
>> $ make
>> /usr/bin/apxs2 -c -I/usr/include/python2.6 -DNDEBUG mod_wsgi.c -L/
>> usr/lib -L/usr/lib/python2.6/config -lpython2.6 -lpthread -ldl -
>> lutil -lm
>> /usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-
>> static x86_64-linux-gnu-gcc -prefer-pic -DLINUX=2 -D_FORTIFY_SOURCE=2 -
>> D_GNU_SOURCE -D_REENTRANT -I/usr/include/apr-1.0 -I/usr/include/
>> openssl -I/usr/include/xmltok -pthread -I/usr/include/apache2 -I/
>> usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include/python2.6
>> -DNDEBUG -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
>> In file included from /usr/include/python2.6/Python.h:8,
>> from mod_wsgi.c:142:
>> /usr/include/python2.6/pyconfig.h:1031:1: warning: "_POSIX_C_SOURCE"
>> redefined
>> In file included from /usr/include/sys/types.h:27,
>> from /usr/include/apr-1.0/apr.h:131,
>> from /usr/include/apache2/ap_config.h:25,
>> from /usr/include/apache2/httpd.h:43,
>> from mod_wsgi.c:34:
>> /usr/include/features.h:158:1: warning: this is the location of the
>> previous definition
>> In file included from /usr/include/python2.6/Python.h:8,
>> from mod_wsgi.c:142:
>> /usr/include/python2.6/pyconfig.h:1040:1: warning: "_XOPEN_SOURCE"
>> redefined
>> In file included from /usr/include/sys/types.h:27,
>> from /usr/include/apr-1.0/apr.h:131,
>> from /usr/include/apache2/ap_config.h:25,
>> from /usr/include/apache2/httpd.h:43,
>> from mod_wsgi.c:34:
>> /usr/include/features.h:160:1: warning: this is the location of the
>> previous definition
>> /usr/share/apr-1.0/build/libtool --silent --mode=link --tag=disable-
>> static x86_64-linux-gnu-gcc -o mod_wsgi.la -rpath /usr/lib/apache2/
>> modules -module -avoid-version mod_wsgi.lo -L/usr/lib -L/usr/lib/
>> python2.6/config -lpython2.6 -lpthread -ldl -lutil -lm
>
> Most likely because -D_GNU_SOURCE is being defined on compiler command
> which is causing features.h to explicitly define _POSIX_C_SOURCE and
> _XOPEN_SOURCE to some value.
>
> The Python header files are also defining the same and so preprocessor
> will complain.
>
> Usually not much you can do about this sort of problem and I guess you
> hope that which ever one ends up winning out doesn't cause some sort
> of incompatibility if they each use different versions.
>
> What values are each of these variables set to in features.h and pyconfig.h?
>
> Graham
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.
>
>
--
-------------------------------------------------------------------------------
Carl J. Nobile (Software Engineer)
[email protected]
-------------------------------------------------------------------------------
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en.