On 2016.10.12 at 11:52 +0200, Bernd Schmidt wrote: > On 10/12/2016 11:31 AM, Markus Trippelsdorf wrote: > > On 2016.10.12 at 00:34 +0200, Bernd Schmidt wrote: > > > 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. > > And that's for a codebase that was written in English to begin with. Would > you mind posting one or two examples if you saw interesting ones, for > reference?
Actually looking more closely it appears that all of the 136 additional warnings for level 2 are bogus, too. Here is an example: switch (class) { case ATA_DEV_SEMB: class = ATA_DEV_ATA; /* some hard drives report SEMB sig */ case ATA_DEV_ATA: case ATA_DEV_ZAC: tf.command = ATA_CMD_ID_ATA; break; > This result suggests that we should probably collapse levels 3-5 into a > single strict one that doesn't try to be clever, and definitely make at most > level 1 the default. Yes, I agree. -- Markus