Bug 154507 - Use of inlined asm statements causes problems for -std=c99 builds
Summary: Use of inlined asm statements causes problems for -std=c99 builds
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
Keywords: InRadar
Depends on:
Reported: 2016-02-20 21:39 PST by Mark Lam
Modified: 2016-02-20 22:15 PST (History)
6 users (show)

See Also:

proposed patch. (3.16 KB, patch)
2016-02-20 21:52 PST, Mark Lam
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2016-02-20 21:39:33 PST
WTF's Assertions.h may inadvertantly get included by other projects that are built with -std=c99.  The use of the inlined asm statements with the keyword "asm" is not recognized when the -std compiler flag is used.  https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html says "When writing code that can be compiled with -ansi and the various -std options, use __asm__ instead of asm (see Alternate Keywords)."

So, to be a good citizen, we can change the use of "asm" in CRASH() to "__asm__" so that we don't break the build of such other projects.
Comment 1 Mark Lam 2016-02-20 21:41:50 PST
Ditto for bmalloc's BAssert.h.
Comment 2 Mark Lam 2016-02-20 21:52:36 PST
Created attachment 271874 [details]
proposed patch.
Comment 3 mitz 2016-02-20 21:55:07 PST
Comment on attachment 271874 [details]
proposed patch.

Not sure the bmalloc part is necessary, but r=me anyway.
Comment 4 Mark Lam 2016-02-20 22:08:20 PST
Comment 5 Mark Lam 2016-02-20 22:15:22 PST
Thanks for the review.  Landed in r196871: <http://trac.webkit.org/r196871>.