https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118308
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- It is only undefined behavior if you use the value from a function which has a return type but does not return a value. The example you have in comment #0 is 100% well defined C code. Note C++ is different in that if you fall through without a return value, then it would be undefined at the point of the fall through. So the code in comment #0 is undefined C++ code.