Re: additional GCC warnings

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: additional GCC warnings
Date: 2004-10-17 17:50:46
Message-ID: 9353.1098035446@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> writes:
> Recent versions of GCC support some additional warning flags that I
> think would be useful to enable for building PostgreSQL:

> -Wmissing-declarations ("Warn if a global function is defined without a
> previous declaration.")

Hm? We have always used that one.

> -Wdeclaration-after-statement (Recent versions of GCC allow declarations
> and statements to be intermixed in C; enabling this flag would enforce
> the current convention of avoiding this style.)

Ick. If the default is to allow that, then yes we need a warning.
I'd be fairly annoyed if it's not an error, in fact.

> Since some of these flags were added to GCC relatively recently, we
> would probably need to test if the local gcc supports the flags via
> configure.

Yeah, you would: it looks like gcc treats an unrecognized -W option
as an error:

$ gcc -Wabc z.c
cc1: Invalid option `-Wabc'
$ echo $?
1
$

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-10-17 17:52:52 Re: 7.4 changes
Previous Message Tom Lane 2004-10-17 17:19:16 Re: Nearing final release?