changeset 32089:7f6ac03eb2ce

Separate compiler warning flags from other compiler flags. This allows setting some warning flags for C but not for C++ and fixes a bunch of warnings when compiling C++ files with C-only warning flags.
author diego
date Sat, 11 Sep 2010 23:30:52 +0000
parents ea16ed8259be
children 535ebcd085e4
files configure
diffstat 1 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sat Sep 11 23:22:01 2010 +0000
+++ b/configure	Sat Sep 11 23:30:52 2010 +0000
@@ -2565,11 +2565,13 @@
 # Checking for CFLAGS
 _install_strip="-s"
 if test "$_profile" != "" || test "$_debug" != "" ; then
-  CFLAGS="-W -Wall -O2 $_march $_mcpu $_pipe $_debug $_profile"
+  CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
+  WARNFLAGS="-W -Wall"
   _install_strip=
 elif test -z "$CFLAGS" ; then
   if test "$cc_vendor" = "intel" ; then
-    CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer -wd167 -wd556 -wd144"
+    CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
+    WARNFLAGS="-wd167 -wd556 -wd144"
   elif test "$cc_vendor" = "sun" ; then
     CFLAGS="-O2 $_march $_mcpu $_pipe -xc99 -xregs=frameptr"
   elif test "$cc_vendor" = "clang"; then
@@ -2577,7 +2579,8 @@
   elif test "$cc_vendor" != "gnu" ; then
     CFLAGS="-O2 $_march $_mcpu $_pipe"
   else
-    CFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls -O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+    CFLAGS="-O4 $_march $_mcpu $_pipe -ffast-math -fomit-frame-pointer"
+    WARNFLAGS="-Wall -Wno-switch -Wno-parentheses -Wpointer-arith -Wredundant-decls"
     extra_ldflags="$extra_ldflags -ffast-math"
   fi
 else
@@ -2585,13 +2588,13 @@
 fi
 
 if test "$cc_vendor" = "gnu" ; then
-  cflag_check -std=gnu99 && CFLAGS="-std=gnu99 $CFLAGS"
-  cflag_check -Wdeclaration-after-statement && CFLAGS="-Wdeclaration-after-statement $CFLAGS"
-  cflag_check -Wno-pointer-sign && CFLAGS="-Wno-pointer-sign $CFLAGS"
-  cflag_check -Wdisabled-optimization && CFLAGS="-Wdisabled-optimization $CFLAGS"
-  cflag_check -Wundef && CFLAGS="-Wundef $CFLAGS"
-  cflag_check -Wmissing-prototypes && CFLAGS="-Wmissing-prototypes $CFLAGS"
-  cflag_check -Wstrict-prototypes && CFLAGS="-Wstrict-prototypes $CFLAGS"
+  cflag_check -Wundef && WARNFLAGS="-Wundef $WARNFLAGS"
+  cflag_check -std=gnu99 && WARN_CFLAGS="-std=gnu99 $WARN_CFLAGS"
+  cflag_check -Wdeclaration-after-statement && WARN_CFLAGS="-Wdeclaration-after-statement $WARN_CFLAGS"
+  cflag_check -Wno-pointer-sign && WARN_CFLAGS="-Wno-pointer-sign $WARN_CFLAGS"
+  cflag_check -Wdisabled-optimization && WARN_CFLAGS="-Wdisabled-optimization $WARN_CFLAGS"
+  cflag_check -Wmissing-prototypes && WARN_CFLAGS="-Wmissing-prototypes $WARN_CFLAGS"
+  cflag_check -Wstrict-prototypes && WARN_CFLAGS="-Wstrict-prototypes $WARN_CFLAGS"
 else
   CFLAGS="-D_ISOC99_SOURCE -D_BSD_SOURCE $CFLAGS"
 fi
@@ -8620,9 +8623,9 @@
 INSTALLSTRIP = $_install_strip
 WINDRES = $_windres
 
-CFLAGS   = $CFLAGS $extra_cflags
+CFLAGS   = $WARNFLAGS $WARN_CFLAGS $CFLAGS $extra_cflags
 ASFLAGS  = \$(CFLAGS)
-CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags
+CXXFLAGS = $WARNFLAGS $CXXFLAGS $extra_cflags $extra_cxxflags
 CC_DEPFLAGS = $DEPFLAGS
 AS_DEPFLAGS = $DEPFLAGS