summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2019-08-25 22:51:37 +0100
committerColin Watson <cjwatson@debian.org>2019-08-25 22:51:37 +0100
commitd986f98de23da09643e097227b2211910a63f6b3 (patch)
tree05ba00cfef17c07de7d8acbffaaa8c9e4ed3fe0c /configure.ac
parent4b1626c8d979f2ebd195f061d07f1e57d90690fb (diff)
Enable many more GCC warnings
* bootstrap.conf (gnulib_modules): Add manywarnings. * configure.ac: Add gl_MANYWARN_ALL_GCC, with some refinements to disable -Wsystem-headers and -Wmissing-field-initializers. Define GNULIB_NO_VLA=1 to avoid tripping over -Wvla. * src/accessdb.c (help_filter): Disable -Wformat-nonliteral around this function. * src/man.c (help_filter): Likewise. * src/check_mandirs.c (gripe_rwopen_failed, update_db_time): Factor out EAGAIN || EWOULDBLOCK check to ... (is_eagain): ... here, with -Wlogical-op disabled. * src/lexgrog.l, src/zsoelim.l: Disable -Wsuggest-attribute=malloc, -Wsuggest-attribute=pure, and -Wunused-macros.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 14 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index eaba176e..fed09ba8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,17 +61,20 @@ case $host_os in
CFLAGS="$CFLAGS -YPOSIX"
;;
esac
-if test "$GCC" = yes
-then
- gl_WARN_ADD([-W])
- gl_WARN_ADD([-Wpointer-arith])
- gl_WARN_ADD([-Wwrite-strings])
- gl_WARN_ADD([-Wstrict-prototypes])
- gl_WARN_ADD([-Wshadow])
- gl_WARN_ADD([-Wformat-security])
- gl_WARN_ADD([-Wredundant-decls])
- gl_WARN_ADD([-Wno-missing-field-initializers])
-fi
+
+# Enable all reasonable GCC warnings.
+gl_MANYWARN_ALL_GCC([warnings])
+nw=
+nw="$nw -Wsystem-headers"
+nw="$nw -Wmissing-field-initializers"
+gl_MANYWARN_COMPLEMENT([warnings], [$warnings], [$nw])
+for w in $warnings; do
+ gl_WARN_ADD([$w])
+done
+gl_WARN_ADD([-Wno-missing-field-initializers])
+# Disable use of VLAs by Gnulib to avoid tripping over -Wvla.
+AC_DEFINE([GNULIB_NO_VLA], [1], [Define to 1 to disable use of VLAs.])
+
AC_PROG_INSTALL
AC_PROG_LN_S
AM_PROG_AR