Re: additional GCC warning flags

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: additional GCC warning flags
Date: 2004-10-18 17:19:30
Message-ID: 26826.1098119970@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)com> writes:
> This patch updates configure.in and configure (I re-ran autoconf 2.53).
> It doesn't introduce any additional warning messages locally (Linux, GCC
> 3.4), but might do so on some platforms (the code in src/port/ is likely
> to trigger some warnings, I think). Because of that, I think it is
> probably best to save this for 8.1

As long as it can only introduce warnings and not errors, I think it is
fine to apply now. It might help us flush out some portability issues
--- we are just coming up on the stage of officially calling for port
reports for 8.0, so it seems like now is a good time to put it in.

One thing I'd suggest is that the "if test "$GCC" = yes; then"
conditional go outside the PGAC macros, ie

if test "$GCC" = yes; then
PGAC_PROG_CC_WARN_DECL_AFTER_STMT
PGAC_PROG_CC_WARN_OLD_STYLE_DEFN
PGAC_PROG_CC_WARN_ENDIF_LABELS
fi

as otherwise people with non-gcc compilers will think configure is
pretty stupid even to be making the tests.

Also, how about removing the conditional CFLAGS hacking from
Makefile.global.in entirely, and change the above to

if test "$GCC" = yes; then
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes"
PGAC_PROG_CC_WARN_DECL_AFTER_STMT
PGAC_PROG_CC_WARN_OLD_STYLE_DEFN
PGAC_PROG_CC_WARN_ENDIF_LABELS
fi

which localizes the logic a tad more, and keeps the CFLAGS entries in a
rational-looking order.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-10-18 17:21:04 Re: additional GCC warning flags
Previous Message Tom Lane 2004-10-18 17:06:57 Re: pg_regress --temp-keep