On 2016.10.12 at 00:34 +0200, Bernd Schmidt wrote:
> On 10/11/2016 11:52 PM, Jakub Jelinek wrote:
> > The following patch introduces difference warning levels for
> > -Wimplicit-fallthrough warning, so projects can choose if they want to
> > honor only attributes (-Wimplicit-fallthrough=5), or what kind of comments.
> > =4 is very picky and accepts only very small amount of comments, =3 is what
> > we had before this patch, =2 looks case insensitively for falls?[ 
> > \t-]*thr(u|ough)
> > anywhere in the comment, =1 accepts any comment, =0 is the same as
> > -Wno-implicit-fallthrough - disables the warning.
> > 
> > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
> 
> I think this is ok, and thank you very much for doing this.
> 
> > The patch keeps as the default the current forms, I'm not against changing
> > it to =2 if there is consensus on it, but would strongly prefer doing that
> > incrementally, as e.g. we'll need to adjust the testsuite for that, and
> > perhaps also use =3 as the warning for gcc bootstraps when we are already =3
> > mode clear.
> 
> It's a discussion we should have, but I agree it should be done
> incrementally. I would argue for =1 as the default.

Here are some numbers for an allmodconfig Linux kernel on pcc64le:

-Wimplicit-fallthrough=1 :  951 warnings
-Wimplicit-fallthrough=2 : 1087 warnings
-Wimplicit-fallthrough=3 : 1209 warnings

I randomly looked at the differences and almost all additional
-Wimplicit-fallthrough=2 warnings are bogus (~5% are genuine).
And _all_ additional -Wimplicit-fallthrough=3 warnings appear
to be bogus.

-- 
Markus

Reply via email to