Re: [PATCH 0/7] Silence even more W=2 warnings

From: Jeff Kirsher
Date: Mon Sep 22 2014 - 17:22:10 EST


On Mon, 2014-09-22 at 22:33 +0200, Borislav Petkov wrote:
> On Mon, Sep 22, 2014 at 01:09:33PM -0700, Jeff Kirsher wrote:
> > Sorry I am very frustrated at your response.
>
> You shouldn't be. Judging by your reply below it seems we do actually
> agree... mostly :-)
>
> > I am not saying that the proposed added MACRO is the best solution to
> > this issue. Several other maintainers have actually responded in a
> > similar manner to the macros being added and came back that the better
> > solution would be to fix the code so that the warnings do not occur in
> > the first place.
>
> Right, this would be optimal.
>
> > So I guess I was hoping for more of the response, that "let's fix this
> > the code so that the warnings do not appear in the first place".
> >
> > I agree with you completely that I do not like the idea of the MACROS
> > being added to silence these warnings. I just disagree that not doing
> > anything to fix the warnings is far worse.
>
> Ok, good, so we're on the same page here.
>
> > Why grep through 100,000 warnings, when we should be fixing the code to
> > prevent 100,000 warnings. Not saying that the MACRO is the best
> > solution, it is just a solution, in hopes that it spurs discussions like
> > this on how to properly fix the warnings. Not a discussion on how to
> > grep through the warnings and do nothing.
>
> There's only one thing I don't understand: why is so bad to grep through
> the warnings? I mean, sure, fixing them *without* jumping through hoops
> to do so is the optimal thing. But what's wrong with grepping through
> them?

Nothing is wrong with grepping for an error, especially when you know
the error your grepping for. But then again, why grep when it can be
fixed to begin with? The fact that there are over 100,000
warnings/errors to begin with is somewhat disconcerting. It makes me
wonder whether it was due to coding laziness.

>
> Btw, out of curiosity, what is your use case for staring at those W=2
> warnings?

To make a better (more solid) network driver? Mark has found it useful
to do the W= builds. For me personally, I do not bother because there
are over 100,000 warnings and it takes forever to get through a build
and then grep for our drivers to see if they are generating any
warnings.

>
> In thinking about it, what we could also do is simply move the noisiest
> ones to W=3 or so, or even add another W= level. It'll be interesting to
> hear your use case though. AFAICT, this is the first time I hear of a
> more, let's say, serious use case of W= since we added the W= things a
> couple of years ago. :-)
>

I could see this useful if there is no way to fix the issue that really
is not an issue and the compiler just does not know any better, but this
concerns me that we would get into a bad habit. "Oh I really do not
want to fix this, so I will just make it so that people we not have to
see this warning/error" Again, sounds lazy to me, of course I am just
speaking in a generalization. I am sure that some of the warnings will
fall into the category of, it needs to be silenced and not fixed because
the fix is far more troublesome. I just cannot believe that most or all
the warnings would be that way.

> Thanks.
>


Attachment: signature.asc
Description: This is a digitally signed message part