Bug 719659 - Add -std=gnu99 to CFLAGS so that gcc and friends permit use of C99 constructs without warnings. This doesn't mean that everything in C99 is permitted now -- only the stuff supported by all the compilers we care about, including MSVC. r=espindola
authorJeff Walden <jwalden@mit.edu>
Fri, 20 Jan 2012 19:00:55 -0800
changeset 86360 886f040f2844f96399ad56e1c793c759bae38d43
parent 86359 7026011a83df40a996b40afaa413d8def439791f
child 86361 1efdc864bce257b69b8aab23baee4a1a75217f78
child 86735 1a08877de7ed89df2e13535a571bcd97f0287958
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersespindola
bugs719659
milestone12.0a1
Bug 719659 - Add -std=gnu99 to CFLAGS so that gcc and friends permit use of C99 constructs without warnings. This doesn't mean that everything in C99 is permitted now -- only the stuff supported by all the compilers we care about, including MSVC. r=espindola
configure.in
js/src/configure.in
--- a/configure.in
+++ b/configure.in
@@ -1822,16 +1822,19 @@ if test "$OS_TARGET" = "Android"; then
     LDFLAGS="$LDFLAGS $STLPORT_LDFLAGS"
     LIBS="$LIBS $STLPORT_LIBS"
 fi
 
 dnl ========================================================
 dnl GNU specific defaults
 dnl ========================================================
 if test "$GNU_CC"; then
+    # Per bug 719659 comment 2, some of the headers on ancient build machines
+    # require gnu89 inline semantics.  But otherwise, we use C99.
+    CFLAGS="$CFLAGS -std=gnu99 -fgnu89-inline"
     # FIXME: Let us build with strict aliasing. bug 414641.
     CFLAGS="$CFLAGS -fno-strict-aliasing"
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
     DSO_LDOPTS='-shared'
     if test "$GCC_USE_GNU_LD"; then
         # Don't allow undefined symbols in libraries
         DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1760,16 +1760,19 @@ if test "$OS_TARGET" = "Android"; then
     ANDROID_CPPFLAGS="$CPPFLAGS"
     ANDROID_LDFLAGS="$LDFLAGS"
 fi
 
 dnl ========================================================
 dnl GNU specific defaults
 dnl ========================================================
 if test "$GNU_CC"; then
+    # Per bug 719659 comment 2, some of the headers on ancient build machines
+    # require gnu89 inline semantics.  But otherwise, we use C99.
+    CFLAGS="$CFLAGS -std=gnu99 -fgnu89-inline"
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
     DSO_LDOPTS='-shared'
     if test "$GCC_USE_GNU_LD"; then
         # Don't allow undefined symbols in libraries
         DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
     fi
     WARNINGS_AS_ERRORS='-Werror -Wno-error=uninitialized'