summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2018-10-20 13:15:31 +0200
committerJoel Rosdahl <joel@rosdahl.net>2018-10-24 22:11:50 +0200
commit21ded3ae71eb2848e381d18424216149e00f9068 (patch)
tree651b9621ada9bcf28a0d56315e39beecd7bff98a
parent4a05ba3530d4f662b66e415345cfcaf87347436f (diff)
downloadccache-21ded3ae71eb2848e381d18424216149e00f9068.tar.gz
Always enable “more warnings” in dev mode
-rw-r--r--configure.ac22
-rw-r--r--dev.mk.in2
2 files changed, 16 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index d6349545..5ac51345 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,7 @@ AC_SUBST(disable_man)
AC_SUBST(extra_libs)
AC_SUBST(getopt_long_c)
AC_SUBST(include_dev_mk)
+AC_SUBST(more_warnings)
AC_SUBST(no_implicit_fallthrough_warning)
AC_SUBST(test_suites)
@@ -52,17 +53,24 @@ else
CFLAGS="$CFLAGS -O"
fi
+more_warnings="-Wextra -Wpedantic"
+if test "$ac_compiler_clang" = yes; then
+ more_warnings="$more_warnings -Weverything"
+ more_warnings="$more_warnings -Wno-conversion"
+ more_warnings="$more_warnings -Wno-disabled-macro-expansion"
+ more_warnings="$more_warnings -Wno-double-promotion"
+ more_warnings="$more_warnings -Wno-float-conversion"
+ more_warnings="$more_warnings -Wno-format-nonliteral"
+ more_warnings="$more_warnings -Wno-padded"
+ more_warnings="$more_warnings -Wno-shorten-64-to-32"
+ more_warnings="$more_warnings -Wno-sign-conversion"
+fi
+
AC_ARG_ENABLE(more_warnings,
[AS_HELP_STRING([--enable-more-warnings],
[enable more compiler warnings])])
if test x${enable_more_warnings} = xyes; then
- CFLAGS="$CFLAGS -Wextra -Wpedantic"
- if test "$ac_compiler_clang" = yes; then
- CFLAGS="$CFLAGS -Weverything"
- CFLAGS="$CFLAGS -Wno-padded -Wno-disabled-macro-expansion -Wno-format-nonliteral"
- CFLAGS="$CFLAGS -Wno-double-promotion -Wno-float-conversion"
- CFLAGS="$CFLAGS -Wno-conversion -Wno-shorten-64-to-32 -Wno-sign-conversion"
- fi
+ CFLAGS="$CFLAGS $more_warnings"
fi
AC_HEADER_DIRENT
diff --git a/dev.mk.in b/dev.mk.in
index 914786ee..fde4e770 100644
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -1,6 +1,6 @@
# GNU make syntax reigns in this file.
-all_cflags += -Werror
+all_cflags += -Werror @more_warnings@
all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$<)).d
A2X = a2x