# HG changeset patch # User al # Date 1374275238 0 # Node ID cee30532995edb04dff0d24ff2b4debd172e757a # Parent 1d34ea86b8923779ac72dc9db694976d27d05807 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. diff -r 1d34ea86b892 -r cee30532995e configure --- 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