Consider this program:
#include <limits.h>
#include <Python.h>
int main (int arg, char **argv)
{
return 0;
}
We compile it like this
cc -Wall -I/usr/include/python2.3 -c aa.c
And get
In file included from /usr/include/python2.3/Python.h:8,
from aa.c:3:
/usr/include/python2.3/pyconfig.h:853:1: warning:
"_POSIX_C_SOURCE" redefined
In file included from /usr/include/limits.h:26,
from
/usr/lib/gcc-lib/i486-linux/3.3.4/include/limits.h:122,
from
/usr/lib/gcc-lib/i486-linux/3.3.4/include/syslimits.h:7,
from
/usr/lib/gcc-lib/i486-linux/3.3.4/include/limits.h:11,
from aa.c:2:
/usr/include/features.h:171:1: warning: this is the
location of the previous definition
Python.h has redefind a symbol which got defined by
including
limits.h. This is unfriendly to programs which embed
Python.
I suspect that there are definitions in pyconfig.h
which are only
relevant when building the Python distribution. Such
definitions
should not be exposed to embedders or builders of 3rd
party modules.
I can make the warning go away by including Python.h
first. But my application has its own config.h -
strange that Python's has to go
in front of it.
|