diff options
author | Guillem Jover <guillem@debian.org> | 2016-09-04 17:17:15 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-10-29 16:02:49 +0200 |
commit | d72b33214a2cd398b34a921500abc0c5e4968be1 (patch) | |
tree | 09ba812bbeda3ee5b8d7fcefe4d6534f8058f004 /m4 | |
parent | 4cef597299b9d9e7a229365f127156c46aacc51d (diff) | |
download | dpkg-d72b33214a2cd398b34a921500abc0c5e4968be1.tar.gz |
build: Check the availability of -Wpositive variant instead of -Wno-positive
At least gcc and clang do not warn on -Wno-* warning flags, only when
something else needs to be reported, which defeats our test. In those
cases pass an additional argument that will be what we will actually
check, but not use afterwards.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/dpkg-compiler.m4 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4 index 5ac9873b0..ad11c1943 100644 --- a/m4/dpkg-compiler.m4 +++ b/m4/dpkg-compiler.m4 @@ -4,6 +4,8 @@ # DPKG_CHECK_COMPILER_FLAG # ------------------------ AC_DEFUN([DPKG_CHECK_COMPILER_FLAG], [ + m4_define([dpkg_check_flag], [m4_default([$2], [$1])]) + AC_LANG_CASE( [C], [ m4_define([dpkg_compiler], [$CC]) @@ -21,7 +23,7 @@ AC_DEFUN([DPKG_CHECK_COMPILER_FLAG], [ ]) AC_CACHE_CHECK([whether ]dpkg_compiler[ accepts $1], [dpkg_varname_cache], [ AS_VAR_COPY([dpkg_varname_save], [dpkg_varname]) - AS_VAR_SET([dpkg_varname], ["$1 -Werror"]) + AS_VAR_SET([dpkg_varname], ["-Werror dpkg_check_flag"]) AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[]]) ], [ @@ -43,9 +45,11 @@ AC_DEFUN([DPKG_CHECK_COMPILER_FLAG], [ AC_DEFUN([DPKG_CHECK_COMPILER_WARNINGS], [ DPKG_CHECK_COMPILER_FLAG([-Wall]) DPKG_CHECK_COMPILER_FLAG([-Wextra]) - DPKG_CHECK_COMPILER_FLAG([-Wno-unused-parameter]) - DPKG_CHECK_COMPILER_FLAG([-Wno-missing-field-initializers]) - DPKG_CHECK_COMPILER_FLAG([-Wno-tautological-constant-out-of-range-compare]) + DPKG_CHECK_COMPILER_FLAG([-Wno-unused-parameter], [-Wunused-parameter]) + DPKG_CHECK_COMPILER_FLAG([-Wno-missing-field-initializers], + [-Wmissing-field-initializers]) + DPKG_CHECK_COMPILER_FLAG([-Wno-tautological-constant-out-of-range-compare], + [-Wtautological-constant-out-of-range-compare]) DPKG_CHECK_COMPILER_FLAG([-Wmissing-declarations]) DPKG_CHECK_COMPILER_FLAG([-Wmissing-format-attribute]) DPKG_CHECK_COMPILER_FLAG([-Wformat -Wformat-security]) |