http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55767
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-12-20 19:34:55 UTC --- It's not always possible to make it a hard error and refuse to compile the code. The function might call a function that never returns (but isn't marked with a noreturn attribute) or might be of the form: int& f(bool b) { if (b) { static int i; return i; } } If this is never called with a false argument there's no problem. If it's never called at all there's no problem. Unless GCC's flow analysis is improved I think the most you can hope for is enabling -Wreturn-type by default. I use -Werror=return-type, the warning's there already, use it if you want it.