This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] -Wredundant-decls, do not warn for static forward decl
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Craig Rodrigues <rodrigc at crodrigues dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Aug 2005 22:23:14 +0000 (UTC)
- Subject: Re: [PATCH] -Wredundant-decls, do not warn for static forward decl
- References: <20050828001615.GA3402@crodrigues.org>
On Sat, 27 Aug 2005, Craig Rodrigues wrote:
> 2005-8-27 Craig Rodrigues <rodrigc@gcc.gnu.org>
>
> * c-decl.c (diagnose_mismatched_decls): With -Wredundant-decls,
> do not issue warning for static forward declaration of static variables.
As I understand this patch, it would lose both warnings for
static int i;
static int i = 1;
static int i;
and while removing the warning for the second declaration (initialized
static declaration following one which wasn't initialized) makes sense,
the third declaration is still redundant and should be warned for.
In any case, you need a testcase showing that the cases which should be
warned for still are and those which shouldn't be warned for aren't.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)