Changeset 196871 in webkit


Ignore:
Timestamp:
Feb 20, 2016, 10:14:38 PM (9 years ago)
Author:
mark.lam@apple.com
Message:

Use of inlined asm statements causes problems for -std=c99 builds.
https://bugs.webkit.org/show_bug.cgi?id=154507

Reviewed by Dan Bernstein.

Source/bmalloc:

  • bmalloc/BAssert.h:

Source/WTF:

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.

  • wtf/Assertions.h:
Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r196802 r196871  
     12016-02-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Use of inlined asm statements causes problems for -std=c99 builds.
     4        https://bugs.webkit.org/show_bug.cgi?id=154507
     5
     6        Reviewed by Dan Bernstein.
     7
     8        WTF's Assertions.h may inadvertantly get included by other projects that are built
     9        with -std=c99.  The use of the inlined asm statements with the keyword "asm" is
     10        not recognized when the -std compiler flag is used.
     11
     12        https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html says "When writing code that
     13        can be compiled with -ansi and the various -std options, use __asm__ instead of
     14        asm (see Alternate Keywords)."
     15
     16        So, to be a good citizen, we can change the use of "asm" in CRASH() to "__asm__"
     17        so that we don't break the build of such other projects.
     18
     19        * wtf/Assertions.h:
     20
    1212016-02-18  Brent Fulgham  <bfulgham@apple.com>
    222
  • trunk/Source/WTF/wtf/Assertions.h

    r196554 r196871  
    156156#if defined(NDEBUG) && OS(DARWIN)
    157157#if CPU(X86_64) || CPU(X86)
    158 #define WTFBreakpointTrap()  asm volatile ("int3")
     158#define WTFBreakpointTrap()  __asm__ volatile ("int3")
    159159#elif CPU(ARM_THUMB2)
    160 #define WTFBreakpointTrap()  asm volatile ("bkpt #0")
     160#define WTFBreakpointTrap()  __asm__ volatile ("bkpt #0")
    161161#elif CPU(ARM64)
    162 #define WTFBreakpointTrap()  asm volatile ("brk #0")
     162#define WTFBreakpointTrap()  __asm__ volatile ("brk #0")
    163163#else
    164164#error "Unsupported CPU".
  • trunk/Source/bmalloc/ChangeLog

    r196856 r196871  
     12016-02-20  Mark Lam  <mark.lam@apple.com>
     2
     3        Use of inlined asm statements causes problems for -std=c99 builds.
     4        https://bugs.webkit.org/show_bug.cgi?id=154507
     5
     6        Reviewed by Dan Bernstein.
     7
     8        * bmalloc/BAssert.h:
     9
    1102016-02-19  Joonghun Park  <jh718.park@samsung.com>
    211
  • trunk/Source/bmalloc/bmalloc/BAssert.h

    r196535 r196871  
    3232
    3333#if BCPU(X86_64) || BCPU(X86)
    34 #define BBreakpointTrap()  asm volatile ("int3")
     34#define BBreakpointTrap()  __asm__ volatile ("int3")
    3535#elif BCPU(ARM_THUMB2)
    36 #define BBreakpointTrap()  asm volatile ("bkpt #0")
     36#define BBreakpointTrap()  __asm__ volatile ("bkpt #0")
    3737#elif BCPU(ARM64)
    38 #define BBreakpointTrap()  asm volatile ("brk #0")
     38#define BBreakpointTrap()  __asm__ volatile ("brk #0")
    3939#else
    4040#error "Unsupported CPU".
Note: See TracChangeset for help on using the changeset viewer.