Open jsonn opened 13 years ago
Consider this:
attribute((noreturn)) int foo(void) { exit(1); return 0; }
At the moment, this triggers:
warning: function 'foo' declared 'noreturn' should not return [-Winvalid-noreturn]
I think this warning is bogus and misleading.
(1) The return is dead code, but might exist to help more stupid compilers that can't figure out the noreturn property of exit.
(2) noreturn on a function with a return value other than void is questionable. A warning for that would be nice.
Still applies with r278913
This still applies with r197332.
cloned to rdar://problem/9958379
This is gross code, but we can certainly fix this since (I believe) we already do a reachability analysis.
Extended Description
Consider this:
include
attribute((noreturn)) int foo(void) { exit(1); return 0; }
At the moment, this triggers:
warning: function 'foo' declared 'noreturn' should not return [-Winvalid-noreturn]
I think this warning is bogus and misleading.
(1) The return is dead code, but might exist to help more stupid compilers that can't figure out the noreturn property of exit.
(2) noreturn on a function with a return value other than void is questionable. A warning for that would be nice.