ecpg: fix amd64 warning/bug - Mailing list pgsql-patches

From Neil Conway
Subject ecpg: fix amd64 warning/bug
Date
Msg-id 1137292960.9145.14.camel@localhost.localdomain
Whole thread Raw
Responses Re: ecpg: fix amd64 warning/bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
I see the following when compiling current sources on Linux/AMD64, gcc
4.0.2:

% make -s
[...]src/interfaces/ecpg/ecpglib/descriptor.c: In function
'ECPGset_desc':
[...]src/interfaces/ecpg/ecpglib/descriptor.c:509: warning: passing
argument 1 of 'ECPGget_variable' from incompatible pointer type

(Long paths shortened for brevity.) This seems to result from the patch
by Christof Petig that changes the signature of ECPGget_variable() on
certain platforms, "to work around gcc bug on powerpc and amd64."

http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/ecpglib/execute.c.diff?r1=1.38;r2=1.38.4.1
http://developer.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/ecpglib/extern.h.diff?r1=1.11;r2=1.11.4.1

Christof's patch updated execute.c and extern.h, but neglected to update
descriptor.c, resulting in the above warning (and I would imagine a
crash at runtime if this code is executed on AMD64/PPC, although I
haven't checked).

Attached is a patch that modifies the call to ECPG_get_variable() in
descriptor.c when compiled with GCC on AMD64 and PPC. Barring any
objections, I'll apply this to HEAD and the relevant stable branches
tomorrow or the day after.

-Neil


Attachment

pgsql-patches by date:

Previous
From: "Magnus Hagander"
Date:
Subject: Re: [HACKERS] Fix for running from admin account on win32
Next
From: Tom Lane
Date:
Subject: Re: ecpg: fix amd64 warning/bug