summaryrefslogtreecommitdiff
path: root/m4/dpkg-compiler.m4
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2018-03-25 05:16:32 +0200
committerGuillem Jover <guillem@debian.org>2018-03-25 05:45:47 +0200
commitb268b7096a970ced824d0ab0dc62b6f0e770230c (patch)
tree11600d8a4c18cf893f9d2b401f96dc078dd9dbaf /m4/dpkg-compiler.m4
parenta597f069a9147d5d868637e276f712e41e836512 (diff)
downloaddpkg-b268b7096a970ced824d0ab0dc62b6f0e770230c.tar.gz
build: Automatically replace -Wno- with -W when testing compiler flags
This is less error prone, less repetitive and the correct thing to do ayway. Instead of manually passing the positive form for these flags.
Diffstat (limited to 'm4/dpkg-compiler.m4')
-rw-r--r--m4/dpkg-compiler.m410
1 files changed, 4 insertions, 6 deletions
diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4
index 8acd3998c..0264e82d2 100644
--- a/m4/dpkg-compiler.m4
+++ b/m4/dpkg-compiler.m4
@@ -4,7 +4,7 @@
# DPKG_CHECK_COMPILER_FLAG
# ------------------------
AC_DEFUN([DPKG_CHECK_COMPILER_FLAG], [
- m4_define([dpkg_check_flag], [m4_default([$2], [$1])])
+ m4_define([dpkg_check_flag], m4_bpatsubst([$1], [^-Wno-], [-W]))
AC_LANG_CASE(
[C], [
@@ -45,11 +45,9 @@ 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], [-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([-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([-Wmissing-declarations])
DPKG_CHECK_COMPILER_FLAG([-Wmissing-format-attribute])
DPKG_CHECK_COMPILER_FLAG([-Wformat -Wformat-security])