This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/7652: -Wswitch-break : Warn if a switch case falls through
- From: ac131313 at redhat dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 20 Aug 2002 14:30:11 -0000
- Subject: c/7652: -Wswitch-break : Warn if a switch case falls through
- Reply-to: ac131313 at redhat dot com
>Number: 7652
>Category: c
>Synopsis: -Wswitch-break : Warn if a switch case falls through
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Aug 20 07:36:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: ac131313@redhat.com
>Release: unknown-1.0
>Organization:
>Environment:
>Description:
Suggest a new -Wswitch variant, -Wswitch-break that warns
when one switch statement falls through to the next one vis:
case (foo)
{
case 1: case 2:
printf ("case 1 and 2\n");
break;
case 3: case 4:
printf ("case 3 and case 4\n");
case 5:
printf ("case 5 (and fallthrough for cases 3 and 4\n");
}
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: