[Bug c/91432] gcc -Wimplicit-fallthrough does not warn when fallthrough to break;

ndesaulniers at google dot com gcc-bugzilla@gcc.gnu.org
Thu Jun 4 17:45:25 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91432

Nick Desaulniers <ndesaulniers at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ndesaulniers at google dot com

--- Comment #3 from Nick Desaulniers <ndesaulniers at google dot com> ---
Isn't this still an implicit fallthrough, though?  It may not "be a bug," but
that's why warnings are not errors; they may not result in "bugs."

The issue is that Clang will warn in this case, so developers get confused
about writing compiler-portable code with intentional fallthrough vs being
warned about unintentional fallthrough.

Why shouldn't developers annotate that the implicit fallthrough from `case 1`
to `default` was intentional, making it explicit?


More information about the Gcc-bugs mailing list