This is the mail archive of the gcc@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: GCC warnings for unused global variables


> FWIW, I'm not convinced by the "it is a regression" argument, that is
> streching the notion of "regression".  If we want to take that route,
> then we should stop fixing bugs in the compilers because fixing bugs
> means removing (or adding) something that was (or weren't) 
> there before.
Nah I think you're misinterpreting why folks think this is a regression.
Consider this. You have a tree that today compiles cleanly with -Wall
-Werror. You upgrade your gcc and now just about *every single file*
in the tree causes an error, with no way of turning off the warning
that's causing the new breakage (without also turning off other stuff
that's useful).

This is not a regression because the option is wrong or whats its
telling
you about is handled incorrectly or anything like that. It is a
regression
because of the 30 years of history that preceed the warning, using an
extremely common practice. If a new warning message tickles, say, 100
warnings across a tree, of even 1000, if they're particularly valuable
warning messages, then you need to clean your code up. But this
particular
warning can (and will) affect several very very large trees and just
about
every single .c file in them, and the warning doesn't even buy you much
at all. So you have a static string, or a static int or two that are
no longer used because the hacker that removed the code that uses them
didn't clean up propperly. Big deal. Leaving those things there doesn't
break any code and I seriously doubt it even bloats code by more than
a few bytes here and there (unless you have huge unused structures). So
from an actual diagnostic point of view, this is almost a pedantic
option.
If you are on a bug hunting expedition and want to clean your tree
squeeky clean, you should have the option of asking for this. I just
don't think it should be on by default.

Kean


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