diff options
author | Marc Dietrich <[email protected]> | 2017-11-29 22:25:05 +0100 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2017-12-01 17:09:42 -0800 |
commit | d93fabb013279d06ab025448afce1e5f665880ee (patch) | |
tree | 82e9f16e6e496585f7811fecf1bb92cf3af5788c /configure.ac | |
parent | 0ed952c7e9b811bc11dec64bd4bebcdf4222cc85 (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 <[email protected]>
Reviewed-by: Dylan Baker <[email protected]>
Signed-off-by: Marc Dietrich <[email protected]>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index f378e54b857..475155a96e4 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 |