[Pgpool-general] Missing asprintf declaration

Tatsuo Ishii t-ishii at sra.co.jp
Sat Feb 26 03:15:24 GMT 2005


> I see this during the compilation of pgpool 2.5.1:
> 
> gcc -DHAVE_CONFIG_H -DDEFAULT_CONFIGDIR=\"/etc\" -I. -I. -I.  -Wall -Wmissing-prototypes -Wmissing-declarations   -g -O2 -cpool_error.c
> pool_error.c: In function `pool_error':
> pool_error.c:47: warning: implicit declaration of function `asprintf'
> 
> Since asprintf is a varargs function, this is a real problem.  I had to
> add -D_GNU_SOURCE to CPPFLAGS to quiet the warning.  PostgreSQL proper
> also uses this flag, so it probably won't hurt to add it.

Thanks for finding the bug.

Can I add unconditionaly -D_GNU_SOURCE to:

AM_CPPFLAGS = -Wall -Wmissing-prototypes -Wmissing-declarations

in Makefile.am? Looks like PostgreSQL adds the flag only if the
platform is Linux.
--
Tatsuo Ishii


More information about the Pgpool-general mailing list