Using -Wshadow

From: Neil Conway <neilc(at)samurai(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Using -Wshadow
Date: 2003-11-24 17:25:32
Message-ID: 877k1psmpf.fsf@mailbox.samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

GCC supports the -Wshadow command-line option:

-Wshadow
Warn whenever a local variable shadows another local
variable, parameter or global variable or whenever a
built-in function is shadowed.

Currently, enabling this for the PostgreSQL tree produces a lot of
warnings. Would anyone object if I corrected these usages of a
shadowed local variable, and then enabled this warning flag for
standard GCC builds? (as is currently done for -Wmissing-prototypes,
-Wmissing-declarations, and -Wall).

If there are any other GCC warning flags anyone else feels would be
useful, let me know.

-Neil

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-11-24 17:26:46 Re: CVS HEAD is broken
Previous Message ohp 2003-11-24 17:06:25 How can I avoid that