I see the following when compiling current sources on Linux/AMD64, gcc

% make -s
[...]src/interfaces/ecpg/ecpglib/descriptor.c: In function
[...]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."


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.


*** src/interfaces/ecpg/ecpglib/descriptor.c	fb3a631882aa0836217d36673a88ef2e366468cb
--- src/interfaces/ecpg/ecpglib/descriptor.c	438646854ee9dd098e7c74f2050c5006b8477902
*** 503,509 ****
--- 503,513 ----
  		type = va_arg(args, enum ECPGttype);
+ #if defined(__GNUC__) && (defined (__powerpc__) || defined(__amd64__) || defined(__x86_64__))
+ 		ECPGget_variable(args, type, var, false);
+ #else
  		ECPGget_variable(&args, type, var, false);
+ #endif
  		switch (itemtype)
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to