diff mbox

Change default level for -Wimplicit-fallthrough

Message ID 2fa103b3-9389-0a5e-a253-6b96dfe61d38@redhat.com
State New
Headers show

Commit Message

Bernd Schmidt Nov. 3, 2016, 11:51 a.m. UTC
I'm concerned about the number of false positives for this warning, and 
judging by previous discussions, I'm not alone in this. This patch 
limits it to level 1 (any comment before the case label disables the 
warning) for cases where the user specified no explicit level. It'll 
still generate enough noise that people will be aware of it and can 
choose whether to use a higher level or not.

Bootstrapped and tested on x86_64-linux. Ok?


Bernd

Comments

Jakub Jelinek Nov. 3, 2016, 11:58 a.m. UTC | #1
On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote:
> I'm concerned about the number of false positives for this warning, and

> judging by previous discussions, I'm not alone in this. This patch limits it

> to level 1 (any comment before the case label disables the warning) for

> cases where the user specified no explicit level. It'll still generate

> enough noise that people will be aware of it and can choose whether to use a

> higher level or not.

> 

> Bootstrapped and tested on x86_64-linux. Ok?


I disagree, I'm ok with changing it to 2, but 1 is too much.

	Jakub
Marek Polacek Nov. 3, 2016, 12:03 p.m. UTC | #2
On Thu, Nov 03, 2016 at 12:58:55PM +0100, Jakub Jelinek wrote:
> On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote:

> > I'm concerned about the number of false positives for this warning, and

> > judging by previous discussions, I'm not alone in this. This patch limits it

> > to level 1 (any comment before the case label disables the warning) for

> > cases where the user specified no explicit level. It'll still generate

> > enough noise that people will be aware of it and can choose whether to use a

> > higher level or not.

> > 

> > Bootstrapped and tested on x86_64-linux. Ok?

> 

> I disagree, I'm ok with changing it to 2, but 1 is too much.


Same here.  I'd support the level 2.

	Marek
Bernd Schmidt Nov. 3, 2016, 12:22 p.m. UTC | #3
On 11/03/2016 12:58 PM, Jakub Jelinek wrote:
> On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote:

>> I'm concerned about the number of false positives for this warning, and

>> judging by previous discussions, I'm not alone in this. This patch limits it

>> to level 1 (any comment before the case label disables the warning) for

>> cases where the user specified no explicit level. It'll still generate

>> enough noise that people will be aware of it and can choose whether to use a

>> higher level or not.

>>

>> Bootstrapped and tested on x86_64-linux. Ok?

>

> I disagree, I'm ok with changing it to 2, but 1 is too much.


Well, we have data from our own sources where we had to "fix" lots of 
perfectly good code, and also from the Linux kernel. From an earlier 
discussion:

Markus Trippelsdorf wrote:
>>> 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.

[...]
> Actually looking more closely it appears that all of the 136 additional

> warnings for level 2 are bogus, too.


Also, levels above 1 enforce English as a language, which isn't 
something we should be doing, even if we could detect fallthrough 
comments reliably (and we can't).


Bernd
Jakub Jelinek Nov. 3, 2016, 12:32 p.m. UTC | #4
On Thu, Nov 03, 2016 at 01:22:11PM +0100, Bernd Schmidt wrote:
> On 11/03/2016 12:58 PM, Jakub Jelinek wrote:

> >On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote:

> >>I'm concerned about the number of false positives for this warning, and

> >>judging by previous discussions, I'm not alone in this. This patch limits it

> >>to level 1 (any comment before the case label disables the warning) for

> >>cases where the user specified no explicit level. It'll still generate

> >>enough noise that people will be aware of it and can choose whether to use a

> >>higher level or not.

> >>

> >>Bootstrapped and tested on x86_64-linux. Ok?

> >

> >I disagree, I'm ok with changing it to 2, but 1 is too much.

> 

> Well, we have data from our own sources where we had to "fix" lots of

> perfectly good code, and also from the Linux kernel. From an earlier

> discussion:


That data wasn't really convincing on this.  All it proved is that most of
the cases are (likely) deliberate fall-throughs without any comment
whatsoever, the rest is in the noise.  As one needs to deal with those
where comments are missing altogether, dealing with the noise is acceptable.

> Markus Trippelsdorf wrote:

> >>>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.

> [...]

> >Actually looking more closely it appears that all of the 136 additional

> >warnings for level 2 are bogus, too.

> 

> Also, levels above 1 enforce English as a language, which isn't something we

> should be doing, even if we could detect fallthrough comments reliably (and

> we can't).


If you use non-english comment, then you need to add lint-like comments for
this, or attributes.  IMHO it is really not very high cost (compared to
all those without any comment at all) to adjust code, what takes time is to
analyze if something is intentional or invalid fallthrough.  The clearer the
comments are on that, the better.

	Jakub
Markus Trippelsdorf Nov. 3, 2016, 12:55 p.m. UTC | #5
On 2016.11.03 at 13:32 +0100, Jakub Jelinek wrote:
> On Thu, Nov 03, 2016 at 01:22:11PM +0100, Bernd Schmidt wrote:

> > On 11/03/2016 12:58 PM, Jakub Jelinek wrote:

> > >On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote:

> > >>I'm concerned about the number of false positives for this warning, and

> > >>judging by previous discussions, I'm not alone in this. This patch limits it

> > >>to level 1 (any comment before the case label disables the warning) for

> > >>cases where the user specified no explicit level. It'll still generate

> > >>enough noise that people will be aware of it and can choose whether to use a

> > >>higher level or not.

> > >>

> > >>Bootstrapped and tested on x86_64-linux. Ok?

> > >

> > >I disagree, I'm ok with changing it to 2, but 1 is too much.

> > 

> > Well, we have data from our own sources where we had to "fix" lots of

> > perfectly good code, and also from the Linux kernel. From an earlier

> > discussion:

> 

> That data wasn't really convincing on this.  All it proved is that most of

> the cases are (likely) deliberate fall-throughs without any comment

> whatsoever, the rest is in the noise.  As one needs to deal with those

> where comments are missing altogether, dealing with the noise is acceptable.


Without Bernd's patch to set the default to 1 you will drown in false
positives once you start using gcc-7 to build a whole distro. On my
Gentoo test box anything but level 1 is simply unacceptable, because you
will miss important other warnings in the -Wimplicit-fallthrough noise
otherwise.

-- 
Markus
Jakub Jelinek Nov. 3, 2016, 1:24 p.m. UTC | #6
On Thu, Nov 03, 2016 at 01:55:33PM +0100, Markus Trippelsdorf wrote:
> On 2016.11.03 at 13:32 +0100, Jakub Jelinek wrote:

> > On Thu, Nov 03, 2016 at 01:22:11PM +0100, Bernd Schmidt wrote:

> > > On 11/03/2016 12:58 PM, Jakub Jelinek wrote:

> > > >On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote:

> > > >>I'm concerned about the number of false positives for this warning, and

> > > >>judging by previous discussions, I'm not alone in this. This patch limits it

> > > >>to level 1 (any comment before the case label disables the warning) for

> > > >>cases where the user specified no explicit level. It'll still generate

> > > >>enough noise that people will be aware of it and can choose whether to use a

> > > >>higher level or not.

> > > >>

> > > >>Bootstrapped and tested on x86_64-linux. Ok?

> > > >

> > > >I disagree, I'm ok with changing it to 2, but 1 is too much.

> > > 

> > > Well, we have data from our own sources where we had to "fix" lots of

> > > perfectly good code, and also from the Linux kernel. From an earlier

> > > discussion:

> > 

> > That data wasn't really convincing on this.  All it proved is that most of

> > the cases are (likely) deliberate fall-throughs without any comment

> > whatsoever, the rest is in the noise.  As one needs to deal with those

> > where comments are missing altogether, dealing with the noise is acceptable.

> 

> Without Bernd's patch to set the default to 1 you will drown in false

> positives once you start using gcc-7 to build a whole distro. On my

> Gentoo test box anything but level 1 is simply unacceptable, because you

> will miss important other warnings in the -Wimplicit-fallthrough noise

> otherwise.


That is really strange.  First of all, most of packages aren't compiled with
-Wextra/-W.  And in those that are, are you sure that that no comment at all
for the implicit fallthroughs isn't significantly more common than the
set of comments that are accepted by -Wimplicit-fallthrough=1 and not
accepted by -Wimplicit-fallthrough=2?

	Jakub
Markus Trippelsdorf Nov. 3, 2016, 1:35 p.m. UTC | #7
On 2016.11.03 at 14:24 +0100, Jakub Jelinek wrote:
> On Thu, Nov 03, 2016 at 01:55:33PM +0100, Markus Trippelsdorf wrote:

> > On 2016.11.03 at 13:32 +0100, Jakub Jelinek wrote:

> > > On Thu, Nov 03, 2016 at 01:22:11PM +0100, Bernd Schmidt wrote:

> > > > On 11/03/2016 12:58 PM, Jakub Jelinek wrote:

> > > > >On Thu, Nov 03, 2016 at 12:51:15PM +0100, Bernd Schmidt wrote:

> > > > >>I'm concerned about the number of false positives for this warning, and

> > > > >>judging by previous discussions, I'm not alone in this. This patch limits it

> > > > >>to level 1 (any comment before the case label disables the warning) for

> > > > >>cases where the user specified no explicit level. It'll still generate

> > > > >>enough noise that people will be aware of it and can choose whether to use a

> > > > >>higher level or not.

> > > > >>

> > > > >>Bootstrapped and tested on x86_64-linux. Ok?

> > > > >

> > > > >I disagree, I'm ok with changing it to 2, but 1 is too much.

> > > > 

> > > > Well, we have data from our own sources where we had to "fix" lots of

> > > > perfectly good code, and also from the Linux kernel. From an earlier

> > > > discussion:

> > > 

> > > That data wasn't really convincing on this.  All it proved is that most of

> > > the cases are (likely) deliberate fall-throughs without any comment

> > > whatsoever, the rest is in the noise.  As one needs to deal with those

> > > where comments are missing altogether, dealing with the noise is acceptable.

> > 

> > Without Bernd's patch to set the default to 1 you will drown in false

> > positives once you start using gcc-7 to build a whole distro. On my

> > Gentoo test box anything but level 1 is simply unacceptable, because you

> > will miss important other warnings in the -Wimplicit-fallthrough noise

> > otherwise.

> 

> That is really strange.  First of all, most of packages aren't compiled with

> -Wextra/-W.  And in those that are, are you sure that that no comment at all

> for the implicit fallthroughs isn't significantly more common than the

> set of comments that are accepted by -Wimplicit-fallthrough=1 and not

> accepted by -Wimplicit-fallthrough=2?


I don't have gathered detailed statistics. But for example a simple
/* drop through */ in a package header file will of course cause many
bogus warnings during the build on level 2.
For the Linux kernel false positives decrease ~20% when switching from
level 3 to 1.

-- 
Markus
Jakub Jelinek Nov. 3, 2016, 1:47 p.m. UTC | #8
On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote:
> I don't have gathered detailed statistics. But for example a simple

> /* drop through */ in a package header file will of course cause many

> bogus warnings during the build on level 2.

> For the Linux kernel false positives decrease ~20% when switching from

> level 3 to 1.


One would have to count only warnings with unique locus (i.e. sort -u them
after grepping them from logs).
But even with 20%, if one spends the energy to analyze the 80%, where
one actually has to analyze the code, just mechanically changing a couple of
common comment kinds into more standardized one isn't going to be
significant.

	Jakub
Bernd Schmidt Nov. 3, 2016, 1:48 p.m. UTC | #9
On 11/03/2016 02:47 PM, Jakub Jelinek wrote:
> On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote:

>> I don't have gathered detailed statistics. But for example a simple

>> /* drop through */ in a package header file will of course cause many

>> bogus warnings during the build on level 2.

>> For the Linux kernel false positives decrease ~20% when switching from

>> level 3 to 1.

>

> One would have to count only warnings with unique locus (i.e. sort -u them

> after grepping them from logs).

> But even with 20%, if one spends the energy to analyze the 80%, where

> one actually has to analyze the code, just mechanically changing a couple of

> common comment kinds into more standardized one isn't going to be

> significant.


But it's a completely pointless exercise which we shouldn't impose on 
users unasked.


Bernd
Jakub Jelinek Nov. 3, 2016, 1:51 p.m. UTC | #10
On Thu, Nov 03, 2016 at 02:48:33PM +0100, Bernd Schmidt wrote:
> 

> On 11/03/2016 02:47 PM, Jakub Jelinek wrote:

> >On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote:

> >>I don't have gathered detailed statistics. But for example a simple

> >>/* drop through */ in a package header file will of course cause many

> >>bogus warnings during the build on level 2.

> >>For the Linux kernel false positives decrease ~20% when switching from

> >>level 3 to 1.

> >

> >One would have to count only warnings with unique locus (i.e. sort -u them

> >after grepping them from logs).

> >But even with 20%, if one spends the energy to analyze the 80%, where

> >one actually has to analyze the code, just mechanically changing a couple of

> >common comment kinds into more standardized one isn't going to be

> >significant.

> 

> But it's a completely pointless exercise which we shouldn't impose on users

> unasked.


It isn't pointless.  Users can have completely unrelated comments in between
case labels, to describe what the case handles etc. and then miss a warning
when the fallthrough is not intentional.

	Jakub
Markus Trippelsdorf Nov. 3, 2016, 1:55 p.m. UTC | #11
On 2016.11.03 at 14:47 +0100, Jakub Jelinek wrote:
> On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote:

> > I don't have gathered detailed statistics. But for example a simple

> > /* drop through */ in a package header file will of course cause many

> > bogus warnings during the build on level 2.

> > For the Linux kernel false positives decrease ~20% when switching from

> > level 3 to 1.

> 

> One would have to count only warnings with unique locus (i.e. sort -u them

> after grepping them from logs).

> But even with 20%, if one spends the energy to analyze the 80%, where

> one actually has to analyze the code, just mechanically changing a couple of

> common comment kinds into more standardized one isn't going to be

> significant.


I should have written: For the Linux kernel the number of warnings
dropped by 20% (going from level 3 to 1) and all of them turned out to
be false positives. And yes, I have used "sort -u".
I'm not sure if I would call 20% insignificant.

-- 
Markus
Jakub Jelinek Nov. 3, 2016, 1:57 p.m. UTC | #12
On Thu, Nov 03, 2016 at 02:55:03PM +0100, Markus Trippelsdorf wrote:
> On 2016.11.03 at 14:47 +0100, Jakub Jelinek wrote:

> > On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote:

> > > I don't have gathered detailed statistics. But for example a simple

> > > /* drop through */ in a package header file will of course cause many

> > > bogus warnings during the build on level 2.

> > > For the Linux kernel false positives decrease ~20% when switching from

> > > level 3 to 1.

> > 

> > One would have to count only warnings with unique locus (i.e. sort -u them

> > after grepping them from logs).

> > But even with 20%, if one spends the energy to analyze the 80%, where

> > one actually has to analyze the code, just mechanically changing a couple of

> > common comment kinds into more standardized one isn't going to be

> > significant.

> 

> I should have written: For the Linux kernel the number of warnings

> dropped by 20% (going from level 3 to 1) and all of them turned out to

> be false positives. And yes, I have used "sort -u".

> I'm not sure if I would call 20% insignificant.


But we are talking about 2 vs. 1 now, so that is likely smaller than 20%.
Plus what those comments in that 2 vs. 1 set are where the warnings differ,
if they are related to fall through or not.

	Jakub
Markus Trippelsdorf Nov. 3, 2016, 2 p.m. UTC | #13
On 2016.11.03 at 14:57 +0100, Jakub Jelinek wrote:
> On Thu, Nov 03, 2016 at 02:55:03PM +0100, Markus Trippelsdorf wrote:

> > On 2016.11.03 at 14:47 +0100, Jakub Jelinek wrote:

> > > On Thu, Nov 03, 2016 at 02:35:57PM +0100, Markus Trippelsdorf wrote:

> > > > I don't have gathered detailed statistics. But for example a simple

> > > > /* drop through */ in a package header file will of course cause many

> > > > bogus warnings during the build on level 2.

> > > > For the Linux kernel false positives decrease ~20% when switching from

> > > > level 3 to 1.

> > > 

> > > One would have to count only warnings with unique locus (i.e. sort -u them

> > > after grepping them from logs).

> > > But even with 20%, if one spends the energy to analyze the 80%, where

> > > one actually has to analyze the code, just mechanically changing a couple of

> > > common comment kinds into more standardized one isn't going to be

> > > significant.

> > 

> > I should have written: For the Linux kernel the number of warnings

> > dropped by 20% (going from level 3 to 1) and all of them turned out to

> > be false positives. And yes, I have used "sort -u".

> > I'm not sure if I would call 20% insignificant.

> 

> But we are talking about 2 vs. 1 now, so that is likely smaller than 20%.

> Plus what those comments in that 2 vs. 1 set are where the warnings differ,

> if they are related to fall through or not.


It is still a 12% reduction (2 vs. 1). I've posted a list of them in the
older thread.

-- 
Markus
Jeff Law Dec. 2, 2016, 5:26 p.m. UTC | #14
On 11/03/2016 05:51 AM, Bernd Schmidt wrote:
> I'm concerned about the number of false positives for this warning, and

> judging by previous discussions, I'm not alone in this. This patch

> limits it to level 1 (any comment before the case label disables the

> warning) for cases where the user specified no explicit level. It'll

> still generate enough noise that people will be aware of it and can

> choose whether to use a higher level or not.

>

> Bootstrapped and tested on x86_64-linux. Ok?

I think we should wait for the distro builds to fire up and see how the 
warning impacts them before making a decision on this patch.

jeff
diff mbox

Patch

c-family/
	* c.opt (Wimplicit-fallthrough=): Default to 1.

gcc/
	* common.opt (Wimplicit-fallthrough=): Default to 1.
	* doc/invoke.texi (-Wextra, -Wimplicit-fallthrough): Adjust
	documentation.

testsuite/
	* c-c++-comon/Wimplicit-fallthrough-1.c: Specify level for
	-Wimplicit-fallthrough
	* c-c++-comon/Wimplicit-fallthrough-10.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-12.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-16.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-19.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-2.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-22.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-25.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-26.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-3.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-4.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-5.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-7.c: Likewise.
	* c-c++-comon/Wimplicit-fallthrough-8.c: Likewise.
	* c-c++-comon/attr-fallthrough-1.c: Likewise.
	* g++.dg/cpp0x/fallthrough1.C: Likewise.
	* objc.dg/Wimplicit-fallthrough-1.m: Likewise.

Index: gcc/c-family/c.opt
===================================================================
--- gcc/c-family/c.opt	(revision 241233)
+++ gcc/c-family/c.opt	(working copy)
@@ -541,7 +541,7 @@  C ObjC Var(warn_implicit) Warning LangEn
 Warn about implicit declarations.
 
 Wimplicit-fallthrough=
-LangEnabledBy(C ObjC C++ ObjC++,Wextra,3,0)
+LangEnabledBy(C ObjC C++ ObjC++,Wextra,1,0)
 ; in common.opt
 
 Wdouble-promotion
Index: gcc/common.opt
===================================================================
--- gcc/common.opt	(revision 241233)
+++ gcc/common.opt	(working copy)
@@ -602,7 +602,7 @@  Common Var(warn_hsa) Init(1) Warning
 Warn when a function cannot be expanded to HSAIL.
 
 Wimplicit-fallthrough
-Common Alias(Wimplicit-fallthrough=,3,0) Warning
+Common Alias(Wimplicit-fallthrough=,1,0) Warning
 
 Wimplicit-fallthrough=
 Common Var(warn_implicit_fallthrough) RejectNegative Joined UInteger Warning
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(revision 241233)
+++ gcc/doc/invoke.texi	(working copy)
@@ -3735,7 +3735,7 @@  name is still supported, but the newer n
 @gccoptlist{-Wclobbered  @gol
 -Wempty-body  @gol
 -Wignored-qualifiers @gol
--Wimplicit-fallthrough=3 @gol
+-Wimplicit-fallthrough=1 @gol
 -Wmissing-field-initializers  @gol
 -Wmissing-parameter-type @r{(C only)}  @gol
 -Wold-style-declaration @r{(C only)}  @gol
@@ -4107,7 +4107,7 @@  This warning is enabled by @option{-Wall
 @item -Wimplicit-fallthrough
 @opindex Wimplicit-fallthrough
 @opindex Wno-implicit-fallthrough
-@option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
+@option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=1}
 and @option{-Wno-implicit-fallthrough} is the same as
 @option{-Wimplicit-fallthrough=0}.
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-1.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-1.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-1.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 /* Test taken from
    <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0188r0.pdf>.  */
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-10.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-10.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-10.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 extern void bar (int);
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-12.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-12.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-12.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough -O2" } */
+/* { dg-options "-Wimplicit-fallthrough=3 -O2" } */
 
 /* Don't let optimizations preclude the warning.  */
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-16.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-16.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-16.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 /* Another nested switch, and with an initialization on top.  Check that
    we do warn here.  */
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-19.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-19.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-19.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 /* Testing non-case labels.  */
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-2.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-2.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-2.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 extern void bar (int);
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-22.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-22.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-22.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 void bar (int);
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-25.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-25.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-25.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Wextra" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 void bar (int);
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-26.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-26.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-26.c	(working copy)
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 void bar (int);
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-3.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-3.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-3.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 extern void bar (int);
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-4.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-4.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-4.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 extern void bar (int);
 
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-5.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-5.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-5.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=2" } */
 
 extern void bar (int);
 extern void die (void) __attribute__((noreturn));
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-7.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-7.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-7.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 extern void bar (int);
 extern int bar2 (void);
Index: gcc/testsuite/c-c++-common/Wimplicit-fallthrough-8.c
===================================================================
--- gcc/testsuite/c-c++-common/Wimplicit-fallthrough-8.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/Wimplicit-fallthrough-8.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 
 extern void grace (int);
 
Index: gcc/testsuite/c-c++-common/attr-fallthrough-1.c
===================================================================
--- gcc/testsuite/c-c++-common/attr-fallthrough-1.c	(revision 241233)
+++ gcc/testsuite/c-c++-common/attr-fallthrough-1.c	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wall -Wextra -Wpedantic" } */
+/* { dg-options "-Wall -Wimplicit-fallthrough=3 -Wpedantic" } */
 
 extern void bar (int);
 void
Index: gcc/testsuite/g++.dg/cpp0x/fallthrough1.C
===================================================================
--- gcc/testsuite/g++.dg/cpp0x/fallthrough1.C	(revision 241233)
+++ gcc/testsuite/g++.dg/cpp0x/fallthrough1.C	(working copy)
@@ -1,6 +1,6 @@ 
 // PR c/7652
 // { dg-do compile { target c++11 } }
-// { dg-options "-Wextra -Wall -Wpedantic" }
+// { dg-options "-Wimplicit-fallthrough=3 -Wall -Wpedantic" }
 
 extern void bar (int);
 void
Index: gcc/testsuite/objc.dg/Wimplicit-fallthrough-1.m
===================================================================
--- gcc/testsuite/objc.dg/Wimplicit-fallthrough-1.m	(revision 241233)
+++ gcc/testsuite/objc.dg/Wimplicit-fallthrough-1.m	(working copy)
@@ -1,6 +1,6 @@ 
 /* PR c/7652 */
 /* { dg-do compile } */
-/* { dg-options "-Wimplicit-fallthrough" } */
+/* { dg-options "-Wimplicit-fallthrough=3" } */
 /* Test taken from
    <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0188r0.pdf>.  */