summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-02-24 18:11:21 +0100
committerThomas Haller <thaller@redhat.com>2015-05-18 23:40:01 +0200
commitc090c3a3319b657b323dd2a3e681961e94ce1346 (patch)
tree878c0d2d3ab6b0baaca181ede61c8ef26f4576ea
parent0d107804a447b8ce959fe90ea72667e234531b15 (diff)
downloadnetwork-manager-applet-c090c3a3319b657b323dd2a3e681961e94ce1346.tar.gz
build: fix detecting support for -Wno-* compiler flags
Since GCC 4.4, gcc does not warn about unknown -Wno-* flags. At least, it does not warning unless another warning is raised as well (https://gcc.gnu.org/wiki/FAQ#wnowarning). We didn't notice up to now, because we only tested flags that GCC actually supports. Hack around this, by checking for the -W* counterpart instead. Taken from NetworkManager, commit 0462104317bfc097a90707a13590248707324846.
-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 3fe8293a..97897e44 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 -Waggregate-return; 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,