Re: [PATCHES] additional GCC warning flags

2004-10-24 Thread Bruce Momjian
Neil Conway wrote: On Wed, 2004-10-20 at 02:07, Tom Lane wrote: Looks reasonable to me. Just one comment: should the -fno-strict-aliasing probe be inside the if test $GCC = yes part? It effectively was in the original. Yeah, makes sense. Patch applied with this fix and Peter's suggested

Re: [PATCHES] additional GCC warning flags

2004-10-19 Thread Neil Conway
On Tue, 2004-10-19 at 11:59, Neil Conway wrote: -Wpointer-arith might be worth enabling. I'll add it to the GCC CFLAGS in the next patch I send in. Attached is a revised patch. Changes: - add -Wpointer-arith to the default CFLAGS when using GCC - add an AC macro AC_PROG_CC_CFLAGS_OPT that

Re: [PATCHES] additional GCC warning flags

2004-10-19 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: -Wstrict-prototypes causes a few distinct warnings but they are emitted repeatedly. At least one does not seem easily solvable: expression_tree_walker() and friends declare the callback function as bool (*walker) (), but it seems a pain to make that type

Re: [PATCHES] additional GCC warning flags

2004-10-19 Thread Peter Eisentraut
Neil Conway wrote: Attached is a revised patch. Changes: Another word from the wise: Never write recent in code designed for longevity. :) BTW, since we're on the topic of compiler options, is there a reason we don't use -g3 with GCC when --enable-debug is specified? It seems worth using to

Re: [PATCHES] additional GCC warning flags

2004-10-19 Thread Alvaro Herrera
On Tue, Oct 19, 2004 at 07:40:56PM +0200, Peter Eisentraut wrote: I'm already not so happy about the new warning options, because they make the compile lines too long. How's that for an argument? ;-) There's a better solution: use an approach similar to that used in the Linux kernel, which

Re: [PATCHES] additional GCC warning flags

2004-10-19 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: There's a better solution: use an approach similar to that used in the Linux kernel, which echoes only the object name that's currently being compiled. If I'm reading this correctly, it requires replacing every default build rule with our own hacked-up

Re: [PATCHES] additional GCC warning flags

2004-10-19 Thread Gaetano Mendola
Tom Lane wrote: Neil Conway [EMAIL PROTECTED] writes: -Wpointer-arith might be worth enabling. I'll add it to the GCC CFLAGS in the next patch I send in. If PG builds cleanly or nearly so with it on, by all means. As you said, -Wcast-align can't be enabled in general at the moment because it

Re: [PATCHES] additional GCC warning flags

2004-10-19 Thread Neil Conway
On Wed, 2004-10-20 at 02:07, Tom Lane wrote: Looks reasonable to me. Just one comment: should the -fno-strict-aliasing probe be inside the if test $GCC = yes part? It effectively was in the original. Yeah, makes sense. Patch applied with this fix and Peter's suggested improvement to a

Re: [PATCHES] additional GCC warning flags

2004-10-18 Thread Bruce Momjian
FYI, I also use: -Wpointer-arith -Wcast-align locally. I think -Wcast-align throws errors on some platforms and can't be use generally. --- Neil Conway wrote: This patch adds code to configure to check if GCC

Re: [PATCHES] additional GCC warning flags

2004-10-18 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] 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).

Re: [PATCHES] additional GCC warning flags

2004-10-18 Thread Bruce Momjian
Agreed, I see no harm in adding it now. --- Tom Lane wrote: Neil Conway [EMAIL PROTECTED] writes: This patch updates configure.in and configure (I re-ran autoconf 2.53). It doesn't introduce any additional warning

Re: [PATCHES] additional GCC warning flags

2004-10-18 Thread Peter Eisentraut
Neil Conway wrote: This patch adds code to configure to check if GCC supports the following warning flags: -Wdeclaration-after-statement (GCC 3.4+), -Wold-style-definition (GCC 3.4+), and -Wendif-labels (GCC 3.3+). Any of these options that are supported by $CC are added to $CFLAGS. Can't you

Re: [PATCHES] additional GCC warning flags

2004-10-18 Thread Neil Conway
On Tue, 2004-10-19 at 03:19, Tom Lane wrote: As long as it can only introduce warnings and not errors, I think it is fine to apply now. Okay -- I'll submit a revised patch that incorporates the suggestions from Peter and yourself later today. -Neil ---(end of

Re: [PATCHES] additional GCC warning flags

2004-10-18 Thread Neil Conway
On Mon, 2004-10-18 at 21:43, Bruce Momjian wrote: FYI, I also use: -Wpointer-arith -Wcast-align locally. I think -Wcast-align throws errors on some platforms and can't be use generally. -Wpointer-arith might be worth enabling. I'll add it to the GCC CFLAGS in the next patch I send

Re: [PATCHES] additional GCC warning flags

2004-10-18 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] writes: -Wpointer-arith might be worth enabling. I'll add it to the GCC CFLAGS in the next patch I send in. If PG builds cleanly or nearly so with it on, by all means. As you said, -Wcast-align can't be enabled in general at the moment because it flags a ton of

Re: [PATCHES] additional GCC warning flags

2004-10-18 Thread Neil Conway
On Tue, 2004-10-19 at 12:21, Tom Lane wrote: When I looked at the current gcc Info docs, I noticed that there seem to be several new warning types that might be worth turning on. Did you consider others beyond the three you're proposing now? I took a look through the list, but I probably

[PATCHES] additional GCC warning flags

2004-10-17 Thread Neil Conway
This patch adds code to configure to check if GCC supports the following warning flags: -Wdeclaration-after-statement (GCC 3.4+), -Wold-style-definition (GCC 3.4+), and -Wendif-labels (GCC 3.3+). Any of these options that are supported by $CC are added to $CFLAGS. The patch also removes