[Webkit-unassigned] [Bug 142524] New: GCC: CRASH() should be annotated with NORETURN

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 9 19:37:32 PDT 2015


            Bug ID: 142524
           Summary: GCC: CRASH() should be annotated with NORETURN
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Minor
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at igalia.com

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.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150310/19618a38/attachment-0002.html>

More information about the webkit-unassigned mailing list