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 (head): -Wunused-static-variable


> I don't think that c-opts.c should be setting flags that are 
> in flags.h.
Corrected.

> 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.

Kean


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