This is the mail archive of the
mailing list for the GCC project.
RE: PATCH (head): -Wunused-static-variable
- From: "Kean Johnston" <jkj at sco dot com>
- To: "'Neil Booth'" <neil at daikokuya dot co dot uk>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 1 May 2003 23:22:54 -0700
- Subject: RE: PATCH (head): -Wunused-static-variable
- Organization: The SCO Group
> I don't think that c-opts.c should be setting flags that are
> in flags.h.
> IMO it should be implied by -Wall and require
heh. Did you follow the thread that lead to this?
> for those who don't want to fix their code. I don't see any
> good reason for turning it off for anything other than char
> arrays, do you?
That is by FAR the most common cause of complaint, yes, because
of the history sccsid/rcsid stuff that's in a bazillion source
files that arent going to change because gcc did. I guess we
*COULD* check on the type although that would make the check a
tad more complicated.
I cant say as I object too terribly strongly to the idea of
having it on with -Wall and turning it off with -Wno-blahblah,
but that implies that for some very large code bases, where
code currently compiles warning-free with -Wall, you now have
to change possibly thousands of makefiles to get to the same
state. Yes I know in a decently constructed tree there would
be a central place to set it but in the real world, not all
trees (or perhaps, to be cynical, even NO trees?) are well
constructed :) All trees suck. Some just less than others.
I'd prefer it if this was NOT on with -Wall, because in a sense
it breaks the real spirit of the option (not the purist
spirit, just the documented one). The key phrase in the doc
is "easy to avoid". Its easy to avoid this warning if you are
writing code from scratch but one HELL of a pain if you're
working with a 30-year old legacy.