Re: additional GCC warning flags - Mailing list pgsql-patches

From Neil Conway
Subject Re: additional GCC warning flags
Date
Msg-id 1098159760.1113.107.camel@localhost.localdomain
Whole thread Raw
In response to Re: additional GCC warning flags  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: additional GCC warning flags
List pgsql-patches
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 missed a few useful
options.

-Wcast-qual emits too many warnings, as does -Wsign-compare.

-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 declaration
more precise.

-Wnested-externs causes a single warning (postmaster.c:580) that seems
fixable, so that might be worth enabling.

-Waggregate-return emits a lot of warnings (since it flags both the call
site and the definition of a function that returns an aggregate type),
but there are relatively few offending functions: GetRedoRecPtr,
XLogInsert(), log_heap_clean(), log_heap_update(), log_heap_move(),
BufferGetFileNode() and SetOutput() (in pg_dump).

If I've missed any you think might be useful, let me know.

-Neil



pgsql-patches by date:

Previous
From: Euler Taveira de Oliveira
Date:
Subject: Translation updates: pt_BR
Next
From: Neil Conway
Date:
Subject: Re: additional GCC warning flags