[Bug c/87950] GCC warns about reaching end of non-void function when all switch cases are completely handled

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 9 08:21:00 GMT 2018


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

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #8)
> Thank you Andrew for clarification of the behavior. Apparently it's quite
> common question. One note that I have about C behavior is that we can maybe
> also add -fstrict-enums to behave the same as in C++. Thoughts?

No, we try not to add extensions which change well defined behavior to be
undefined behavior.  Adding -fstrict-enums for C would cause just that.


More information about the Gcc-bugs mailing list