This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] -Wredundant-decls, do not warn for static forward decl


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]