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.

        * c.opt (Wextra): Add as C/C++/ObjC/ObjC++ option.
        (Wimplicit-fallthrough=): Enable for these languages by -Wextra.

This bit looks like it does a bit more magic than is immediately obvious. Could you elaborate how this works?


Bernd

Reply via email to