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]

[Bug c/83955] false positive implicit-fallthrough warning on switch enum


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.

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