compile warnings
In addition to the ecpg warnings mentioned by Tom, I'm also seeing
compile warnings wrt plpython:
make[3]: Entering directory `/opt/src/pgsql-cvs/pgsql-7.5/src/pl/plpython'
gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes
-Wmissing-declarations -fpic -I. -I/usr/include/python2.3
-I../../../src/include -D_GNU_SOURCE -I/usr/include/et -c -o
plpython.o plpython.c -MMD
In file included from /usr/include/python2.3/Python.h:8,
from plpython.c:58:
/usr/include/python2.3/pyconfig.h:847:1: warning: "_POSIX_C_SOURCE"
redefined
In file included from /usr/include/stdio.h:28,
from ../../../src/include/c.h:60,
from ../../../src/include/postgres.h:48,
from plpython.c:37:
/usr/include/features.h:131:1: warning: this is the location of the
previous definition
ar crs libplpython.a plpython.o
Joe
Joe Conway <mail@joeconway.com> writes:
In addition to the ecpg warnings mentioned by Tom, I'm also seeing
compile warnings wrt plpython:
make[3]: Entering directory `/opt/src/pgsql-cvs/pgsql-7.5/src/pl/plpython'
gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes
-Wmissing-declarations -fpic -I. -I/usr/include/python2.3
-I../../../src/include -D_GNU_SOURCE -I/usr/include/et -c -o
plpython.o plpython.c -MMD
In file included from /usr/include/python2.3/Python.h:8,
from plpython.c:58:
/usr/include/python2.3/pyconfig.h:847:1: warning: "_POSIX_C_SOURCE"
redefined
In file included from /usr/include/stdio.h:28,
from ../../../src/include/c.h:60,
from ../../../src/include/postgres.h:48,
from plpython.c:37:
/usr/include/features.h:131:1: warning: this is the location of the
previous definition
ar crs libplpython.a plpython.o
I think this must be breakage in your local python installation, not in
Postgres. Note the complaint is that /usr/include/python2.3/pyconfig.h
disagrees with /usr/include/features.h ... it's not hard to decide who's
at fault there. PG could be an accessory to the crime, but AFAICS we've
not mucked with include order or predefined symbols for plpython.c
lately; so if we broke it, it was awhile ago.
This is surely not a "must fix tomorrow" issue, but please look into it
when you get back from your road trip.
(Where are you going, anyway? 3600 miles is a long way...)
regards, tom lane
Tom Lane wrote:
Joe Conway <mail@joeconway.com> writes:
In file included from /usr/include/python2.3/Python.h:8,
from plpython.c:58:
/usr/include/python2.3/pyconfig.h:847:1: warning: "_POSIX_C_SOURCE"
redefined
In file included from /usr/include/stdio.h:28,
from ../../../src/include/c.h:60,
from ../../../src/include/postgres.h:48,
from plpython.c:37:
/usr/include/features.h:131:1: warning: this is the location of the
previous definitionI think this must be breakage in your local python installation, not in
Postgres. Note the complaint is that /usr/include/python2.3/pyconfig.h
disagrees with /usr/include/features.h ... it's not hard to decide who's
at fault there. PG could be an accessory to the crime, but AFAICS we've
not mucked with include order or predefined symbols for plpython.c
lately; so if we broke it, it was awhile ago.
I'm on a relatively new/vanilla fedora core 2 system, so the fault might
lie there.
This is surely not a "must fix tomorrow" issue, but please look into it
when you get back from your road trip.
OK, will do.
(Where are you going, anyway? 3600 miles is a long way...)
San Diego to Mississippi and back. Visit family, attend a wedding, etc.
We do this trip every year or two, so I'm used to it by now ;-)
Joe
Tom Lane wrote:
Joe Conway <mail@joeconway.com> writes:
In addition to the ecpg warnings mentioned by Tom, I'm also seeing
compile warnings wrt plpython:make[3]: Entering directory `/opt/src/pgsql-cvs/pgsql-7.5/src/pl/plpython'
gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes
-Wmissing-declarations -fpic -I. -I/usr/include/python2.3
-I../../../src/include -D_GNU_SOURCE -I/usr/include/et -c -o
plpython.o plpython.c -MMD
In file included from /usr/include/python2.3/Python.h:8,
from plpython.c:58:
/usr/include/python2.3/pyconfig.h:847:1: warning: "_POSIX_C_SOURCE"
redefined
In file included from /usr/include/stdio.h:28,
from ../../../src/include/c.h:60,
from ../../../src/include/postgres.h:48,
from plpython.c:37:
/usr/include/features.h:131:1: warning: this is the location of the
previous definition
ar crs libplpython.a plpython.oI think this must be breakage in your local python installation, not in
Postgres. Note the complaint is that /usr/include/python2.3/pyconfig.h
disagrees with /usr/include/features.h ... it's not hard to decide who's
at fault there. PG could be an accessory to the crime, but AFAICS we've
not mucked with include order or predefined symbols for plpython.c
lately; so if we broke it, it was awhile ago.This is surely not a "must fix tomorrow" issue, but please look into it
when you get back from your road trip.
In /usr/include/python2.3/pyconfig.h:
/* Define to activate features from IEEE Stds 1003.1-2001 */
#define _POSIX_C_SOURCE 200112L
And in /usr/include/features.h:
* If _GNU_SOURCE was defined by the user, turn on all the other
* features.
#ifdef _GNU_SOURCE
[...]
# define _POSIX_C_SOURCE 199506L
I find that simply putting
#include <Python.h>
prior to
#include "postgres.h"
in plpython.c eliminates the warnings, and compiles fine, but it isn't
clear to me that it is safe. Thoughts?
Joe
Joe Conway wrote:
Tom Lane wrote:
Joe Conway <mail@joeconway.com> writes:
In addition to the ecpg warnings mentioned by Tom, I'm also seeing
compile warnings wrt plpython:This is surely not a "must fix tomorrow" issue, but please look into it
when you get back from your road trip.I find that simply putting
#include <Python.h>
prior to
#include "postgres.h"
in plpython.c eliminates the warnings, and compiles fine, but it isn't
clear to me that it is safe. Thoughts?
If there are no objections, I plan to commit the attached in a few hours.
Thanks,
Joe
Attachments:
plpython-fix.patchtext/x-patch; name=plpython-fix.patchDownload
Index: src/pl/plpython/plpython.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/pl/plpython/plpython.c,v
retrieving revision 1.51
diff -c -r1.51 plpython.c
*** src/pl/plpython/plpython.c 31 Jul 2004 20:55:45 -0000 1.51
--- src/pl/plpython/plpython.c 4 Aug 2004 22:41:44 -0000
***************
*** 34,39 ****
--- 34,40 ----
*********************************************************************
*/
+ #include <Python.h>
#include "postgres.h"
/* system stuff */
***************
*** 54,60 ****
#include "utils/syscache.h"
#include "utils/typcache.h"
- #include <Python.h>
#include <compile.h>
#include <eval.h>
--- 55,60 ----