This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/83955] false positive implicit-fallthrough warning on switch enum
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Jan 2018 23:02:18 +0000
- Subject: [Bug c/83955] false positive implicit-fallthrough warning on switch enum
- Auto-submitted: auto-generated
- References: <bug-83955-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83955
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-01-26
CC| |msebor at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Without -Wswitch-default GCC doesn't warn for case statements that have labels
for all values of the enumerated controlling expression. I.e., the assumption
is that the controlling expression's value matches one of the enumerators.
Having -Wimplicit-fallthrough warn for such a case statement would run counter
to that philosophy. I think -Wimplicit-fallthrough should do what GCC does
without -Wswitch-default and assume that a case statement that transfers
control out of all labels for all of its controlling expression's enumerators
does not fall through.
With that I will confirm this report as a bug.