summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMarc Dietrich <marvin24@gmx.de>2017-11-29 22:25:05 +0100
committerDylan Baker <dylan@pnwbakers.com>2017-12-01 17:09:42 -0800
commitd93fabb013279d06ab025448afce1e5f665880ee (patch)
tree82e9f16e6e496585f7811fecf1bb92cf3af5788c /configure.ac
parent0ed952c7e9b811bc11dec64bd4bebcdf4222cc85 (diff)
configure: avoid testing for negative compiler options
gcc seems to always accept unsupported negative compiler warning options: echo "int i;" | gcc -c -xc -Wno-bob - # no error echo "int i;" | gcc -c -xc -Walice - # unsupported compiler option Inverting the options fixes the tests. V2: fix options in meson build Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac6
1 files changed, 4 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index f378e54b85..475155a96e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -394,8 +394,10 @@ esac
AC_SUBST([VISIBILITY_CFLAGS])
AC_SUBST([VISIBILITY_CXXFLAGS])
-AX_CHECK_COMPILE_FLAG([-Wno-override-init], [WNO_OVERRIDE_INIT="$WNO_OVERRIDE_INIT -Wno-override-init"]) # gcc
-AX_CHECK_COMPILE_FLAG([-Wno-initializer-overrides], [WNO_OVERRIDE_INIT="$WNO_OVERRIDE_INIT -Wno-initializer-overrides"]) # clang
+dnl For some reason, the test for -Wno-foo always succeeds with gcc, even if the
+dnl option is not supported. Hence, check for -Wfoo instead.
+AX_CHECK_COMPILE_FLAG([-Woverride-init], [WNO_OVERRIDE_INIT="$WNO_OVERRIDE_INIT -Wno-override-init"]) # gcc
+AX_CHECK_COMPILE_FLAG([-Winitializer-overrides], [WNO_OVERRIDE_INIT="$WNO_OVERRIDE_INIT -Wno-initializer-overrides"]) # clang
AC_SUBST([WNO_OVERRIDE_INIT])
dnl