changeset 36269:cee30532995e

build: Keep compiler-specific warning flags for debug or profiling builds Without warning flags like -Werror-implicit-function-declaration some tests like gethostname2 will compile and therefore succeed. But not without causing strange run-time failures later on e.g. when compiled for x86_64 . Having useful warning flags dropped on debug enabled builds seems also counter intuitive to me. This does not necessarily help with all compilers, but that can be fixed if those compilers have the necessary switches to be more strict.
author al
date Fri, 19 Jul 2013 23:07:18 +0000
parents 1d34ea86b892
children cc9eed01e8e7
files configure
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Wed Jul 17 05:32:20 2013 +0000
+++ b/configure	Fri Jul 19 23:07:18 2013 +0000
@@ -2705,11 +2705,7 @@
 
 # Checking for CFLAGS
 _install_strip="-s"
-if test "$_profile" != "" || test "$_debug" != "" ; then
-  CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
-  WARNFLAGS="-W -Wall"
-  _install_strip=
-elif test -z "$CFLAGS" ; then
+if test -z "$CFLAGS" || test "$_profile" != "" || test "$_debug" != ""; then
   if test "$cc_vendor" = "intel" ; then
     CFLAGS="-O2 $_march $_mcpu $_pipe -fomit-frame-pointer"
     WARNFLAGS="-wd167 -wd556 -wd144"
@@ -2725,6 +2721,12 @@
     WARN_CFLAGS="-Werror-implicit-function-declaration"
     extra_ldflags="$extra_ldflags -ffast-math"
   fi
+
+  if test "$_profile" != "" || test "$_debug" != ""; then
+    CFLAGS="-O2 $_march $_mcpu $_pipe $_debug $_profile"
+    WARNFLAGS="-W -Wall $WARNFLAGS"
+    _install_strip=
+  fi
 else
   warn_cflags=yes
 fi