When I used CRASH() at the end of a function I'm working on, I got this warning: warning: control reaches end of non-void function [-Wreturn-type] At first I thought GCC was extremely dumb here, but it turns out that our CRASH() function only gets the noreturn attribute when complied with Clang or MSVC. It should be used with GCC too. I noticed two side-effects of this change, which are simple enough to fix in the same patch: * With that attribute added, GCC will warn that WTFCrash and WTFCrashWithSecurityImplication do return, because it's not smart enough to detect calling the null pointer as a noreturn. Easiest fix is to use __builtin_trap like we already do for Clang. * jsc.cpp intentionally uses a return at the end of a noreturn function to avoid a compiler diagnostic, which now triggers a warning from GCC. The #ifdef here was previously #if !COMPILER(CLANG) && !COMPILER(MSVC) so it must have been added just for GCC, so I've removed it.
Created attachment 248313 [details] Mark CRASH() as noreturn when compiling with GCC
Comment on attachment 248313 [details] Mark CRASH() as noreturn when compiling with GCC Clearing flags on attachment: 248313 Committed r181326: <http://trac.webkit.org/changeset/181326>
All reviewed patches have been landed. Closing bug.
(In reply to comment #2) > Comment on attachment 248313 [details] > Mark CRASH() as noreturn when compiling with GCC > > Clearing flags on attachment: 248313 > > Committed r181326: <http://trac.webkit.org/changeset/181326> It caused a regression on AArch64 Linux, see bug142629 for details.