https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78497
Mark Wielaard <mark at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mark at gcc dot gnu.org
--- Comment #6 from Mark Wielaard <mark at gcc dot gnu.org> ---
Confirmed, this confused me a bit.
Take t.c:
int main (int argc, char **argv)
{
int a;
switch (argc)
{
case 1:
a = 1;
break;
case 2:
a = 2;
/* FALLTHROUGH */
case 3:
a = 3;
break;
}
return a;
}
$ gcc -Werror -Wimplicit-fallthrough t.c
is fine, but...
$ gcc --save-temps -Werror -Wimplicit-fallthrough t.c
t.c: In function ‘main’:
t.c:10:9: error: this statement may fall through
[-Werror=implicit-fallthrough=]
a = 2;
~~^~~
t.c:12:5: note: here
case 3:
^~~~
cc1: all warnings being treated as errors