On Wed, Oct 12, 2016 at 04:04:25PM +0200, Bernd Schmidt wrote:
> On 10/12/2016 01:04 PM, Markus Trippelsdorf wrote:
> >I'm more concerned about the first impression that people will get from
> >this warning. If the fist couple of samples they will look at are
> >clearly bogus (as with the example comments above) they will very
> >quickly disable the warning.
> >And if a small one digit percentage of all potential issues falls
> >through the cracks with -Wimplicit-fallthrough=1 , so be it.
> Yes. Better to give mostly sensible warnings, making people aware of the
> option and maybe encouraging to try higher levels, rather than generating a
> huge amount of noise which will result in some people turning the warning
> off, some making pointles or even incorrect changes to their code (as we saw
> in gcc itself), and generating bad publicity.
But whatever non-zero level it is, the most common case in most projects
will be not the intentional fallthrus marked with custom style comments, but
those not marked at all. E.g. in the linux kernel case, that is 90% of the
warnings with -Wimplicit-fallthrough=2. Whether you tweak another 10% isn't
something that makes significant difference.
What incorrect changes to code in gcc do you have in mind? I just remember
one spot where a /* FALLTHRU */ comment has been added even when it should
be break;, that is no code change. Most of the cases in gcc that had to
change were where there were no fallthru comments at all, not where a custom
style comment has been changed to some more standardized one.