This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c/7652: -Wswitch-break : Warn if a switch case falls through


Synopsis: -Wswitch-break : Warn if a switch case falls through

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Wed Nov 27 07:21:03 2002
State-Changed-Why:
I doubt warning if a switch case falls through is a useful
feature since it is so commonly used in a reasonable way.
Note that if you write case 1: case 2:
you are actually using this, since the "case 1" simply falls
through to the "case 2"...
But I leave it to others to judge whether this would be
useful.
W.
I've been informed that GCC can differentiate between `case 1: case 2:' and a fall through (something about just needing to check for a branch at the end of a switch case block).

Please also remember that, just like all the other -W flags, this is a tool
Like all tools, it can can be used in ways that either help or hinder the user. A skilled user (aka a toolsmith) is, however, capable of determining if/when a tool is applicable.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7652


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]