summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--m4/compiler_warnings.m43
1 files changed, 2 insertions, 1 deletions
diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4
index c05a26d098..412acb9750 100644
--- a/m4/compiler_warnings.m4
+++ b/m4/compiler_warnings.m4
@@ -30,7 +30,8 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-Wundef -Wimplicit-function-declaration \
-Wpointer-arith -Winit-self \
-Wmissing-include-dirs; do
- CFLAGS="$CFLAGS_MORE_WARNINGS $CFLAGS_EXTRA $option $CFLAGS_SAVED"
+ dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning)
+ CFLAGS="$CFLAGS_MORE_WARNINGS $CFLAGS_EXTRA $(printf '%s' "$option" | sed 's/^-Wno-/-W/') $CFLAGS_SAVED"
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,