[MPlayer-dev-eng] [PATCH] build: Keep compiler-specific warning flags for debug and profiling builds

Alexander Strasser eclipse7 at gmx.net
Mon Jul 15 00:34:51 CEST 2013


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.

Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>
---
 configure | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 959691d..6f62eaa 100755
--- a/configure
+++ b/configure
@@ -2705,11 +2705,7 @@ fi # if darwin && test "$cc_vendor" = "gnu" ; then
 
 # 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 @@ elif test -z "$CFLAGS" ; then
     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
-- 


More information about the MPlayer-dev-eng mailing list