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

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 11 15:07:00 GMT 2018


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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #14 from Jason Merrill <jason at gcc dot gnu.org> ---
It would certainly be possible to recognize this situation (all enumerators
handled) and suppress the -Wreturn-type warning even though we can't in general
assume that we can't get other values of the enumeration.  With the ability to
explicitly request warnings in this situation with another flag.  I don't know
how much work that would be.


More information about the Gcc-bugs mailing list