]> granicus.if.org Git - graphviz/commitdiff
improve handling of extra warnings if C99 available
authorJohn Ellson <ellson@research.att.com>
Tue, 26 Jul 2016 00:37:54 +0000 (20:37 -0400)
committerJohn Ellson <ellson@research.att.com>
Tue, 26 Jul 2016 00:37:54 +0000 (20:37 -0400)
configure.ac

index 33c157e0860ea3a52acd0c1d359bf924186d412d..4c1a980e3583a8f43164804bafd19dae41ec4f44 100644 (file)
@@ -304,17 +304,22 @@ if test "x$TCLSH" = "x"; then
 #  fi
 fi
 
+
+dnl -----------------------------------
+dnl checks for compilers
+
+AM_PROG_CC_C_O
+AC_PROG_CC_C99
+AC_PROG_CXX
+AC_PROG_OBJC
+
+AC_C_INLINE
+
 dnl ===========================================================================
 dnl Set GCC compiler flags
 
 if [test "${GCC}" == "yes"]
 then
-  # Enable c99
-  CFLAGS="${CFLAGS} -std=c99"
-  
-  # When enabling c99 on this codebase, this POSIX version should be defined
-  CFLAGS="${CFLAGS} -D_POSIX_C_SOURCE=200112L"
-  
   # Enable common warnings flags
   CFLAGS="${CFLAGS} -Wall"
   
@@ -324,21 +329,13 @@ then
   # Enable specific warning flags not included by -Wall or -Wextra
   CFLAGS="${CFLAGS} -Wmissing-include-dirs -Wswitch-default -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs"
 
-# FIXME - The are not available of centos [6] - need smarter config:
-#    -Wdouble-promotion -Wtrampolines -Wlogical-op
-
+ # if C99, then enable additional warnings
+ if [test "${ac_cv_prog_cc_c99}" != "no"]
+ then
+    # When enabling c99 on this codebase, this POSIX version should be defined
+    CFLAGS="${CFLAGS} -D_POSIX_C_SOURCE=200112L -Wdouble-promotion -Wtrampolines -Wlogical-op"
+  fi
 fi
-
-dnl -----------------------------------
-dnl checks for compilers
-
-AM_PROG_CC_C_O
-#AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_OBJC
-
-AC_C_INLINE
-
 # Workaround for native compilers
 #  HP  : http://bugs.gnome.org/db/31/3163.html
 #  DEC : Enable NaN/Inf