BUG #1019: src/pl/tcl/pltcl.c

Lists: pgsql-bugs
From: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1019: src/pl/tcl/pltcl.c
Date: 2003-12-19 11:12:26
Message-ID: 20031219111226.CAB2DCF81A4@www.postgresql.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 1019
Logged by: Patrick Samson
Email address: p_samson(at)yahoo(dot)com
PostgreSQL version: 7.3.5
Operating system: Cygwin
Description: src/pl/tcl/pltcl.c
Details:

For "configure --with-tcl --without-tk".
'make' doesn't know how to resolve some references.

make[3]: Entering directory `/opt/postgresql-7.3.5/src/pl/tcl'
dlltool --export-all --output-def pltcl.def pltcl.o
dllwrap -o pltcl.dll --dllname pltcl.dll --def pltcl.def pltcl.o ../../../src/utils/dllinit.o -L/usr/local/lib -L../../../src/backend -lpostgres -L/usr/lib -ltcl84
fu000001.o(.idata$3+0xc): undefined reference to `_libpostgres_a_iname'
fu000003.o(.idata$3+0xc): undefined reference to `_libpostgres_a_iname'
fu000004.o(.idata$3+0xc): undefined reference to `_libpostgres_a_iname'
fu000005.o(.idata$3+0xc): undefined reference to `_libpostgres_a_iname'
fu000006.o(.idata$3+0xc): undefined reference to `_libpostgres_a_iname'
fu000007.o(.idata$3+0xc): more undefined references to `_libpostgres_a_iname' follow
nmth000000.o(.idata$4+0x0): undefined reference to `__nm__TopMemoryContext'
nmth000002.o(.idata$4+0x0): undefined reference to `__nm__SPI_tuptable'
nmth000015.o(.idata$4+0x0): undefined reference to `__nm__SPI_processed'
nmth000024.o(.idata$4+0x0): undefined reference to `__nm__Warn_restart'
nmth000128.o(.idata$4+0x0): undefined reference to `__nm__SPI_result'
nmth000133.o(.idata$4+0x0): undefined reference to `__nm__SPI_lastoid'

In src/pl/tcl/pltcl.c:
Permute the order of:
#include "postgres.h"
#include <tcl.h>
so as it appears as:
#include <tcl.h>
#include "postgres.h"

There is still some warnings, but it goes on:
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../src/include -c -o pltcl.o pltcl.c
In file included from ../../../src/include/pg_config.h:673,
from ../../../src/include/c.h:53,
from ../../../src/include/postgres.h:48,
from pltcl.c:41:
../../../src/include/pg_config_os.h:26:1: warning: "DLLIMPORT" redefined
In file included from pltcl.c:39:
/usr/include/tcl.h:201:1: warning: this is the location of the previous definition
pltcl.c: In function `pltcl_init_interp':
pltcl.c:261: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type
pltcl.c:263: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type
pltcl.c:265: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type
pltcl.c:267: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type
pltcl.c:270: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type
pltcl.c:272: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type
pltcl.c:274: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type
pltcl.c:276: warning: passing arg 3 of `Tcl_CreateCommand' from incompatible pointer type
pltcl.c: In function `pltcl_trigger_handler':
pltcl.c:818: warning: passing arg 4 of `Tcl_SplitList' from incompatible pointer type
pltcl.c: In function `pltcl_SPI_prepare':
pltcl.c:1745: warning: passing arg 4 of `Tcl_SplitList' from incompatible pointer type
pltcl.c: In function `pltcl_SPI_execp':
pltcl.c:2054: warning: passing arg 4 of `Tcl_SplitList' from incompatible pointer type

Reference: see also http://archives.postgresql.org/pgsql-cygwin/2003-01/msg00080.php


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>
Cc: p_samson(at)yahoo(dot)com
Subject: Re: BUG #1019: src/pl/tcl/pltcl.c
Date: 2003-12-19 12:15:40
Message-ID: 200312191315.40046.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

> In src/pl/tcl/pltcl.c:
> Permute the order of:
> #include "postgres.h"
> #include <tcl.h>
> so as it appears as:
> #include <tcl.h>
> #include "postgres.h"

I' afraid this is not a fix but just paints over the symptoms. As you
noticed, this topic has already been discussed, and the solution needs to be
a little more involved than this.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "PostgreSQL Bugs List" <pgsql-bugs(at)postgresql(dot)org>, p_samson(at)yahoo(dot)com
Subject: Re: BUG #1019: src/pl/tcl/pltcl.c
Date: 2003-12-19 15:47:30
Message-ID: 9662.1071848850@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> In src/pl/tcl/pltcl.c:
>> Permute the order of:
>> #include "postgres.h"
>> #include <tcl.h>
>> so as it appears as:
>> #include <tcl.h>
>> #include "postgres.h"

> I' afraid this is not a fix but just paints over the symptoms.

... and would create serious new problems of its own, at least on some
platforms. postgres.h has to be the *first* inclusion of any system
headers.

regards, tom lane