summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2020-11-13 10:20:19 -0800
committerJim Meyering <meyering@fb.com>2020-11-26 09:24:24 -0800
commit623008c296577495e00325bd3640a1b0051fa044 (patch)
treee43b52a2a5e8be2876fcadecc330639efb33ba17 /configure.ac
parentfac92da8bce6544582e76a720fe0787c0e0b860a (diff)
downloadgrep-623008c296577495e00325bd3640a1b0051fa044.tar.gz
tests: enable warnings for the gnulib-tests subdir
* gnulib-tests/Makefile.am (AM_CFLAGS): Enable gnulib warning options for these tests. * configure.ac (GNULIB_TEST_WARN_CFLAGS): Disable the same three warning options that coreutils does, and a few more for GCC11.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 14 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0b40a9e3..e279886d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,6 +147,20 @@ if test "$gl_gcc_warnings" = yes; then
gl_WARN_ADD([-Wno-format-nonliteral])
gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
AC_SUBST([GNULIB_WARN_CFLAGS])
+
+ # For gnulib-tests, the set is slightly smaller still.
+ nw=
+ nw="$nw -Wstrict-prototypes"
+ # It's not worth being this picky about test programs.
+ nw="$nw -Wsuggest-attribute=const"
+ nw="$nw -Wsuggest-attribute=pure"
+ nw="$nw -Wsuggest-attribute=format"
+ nw="$nw -Wformat-truncation=2" # False alarm in strerror_r.c
+ nw="$nw -Wold-style-definition"
+ gl_MANYWARN_COMPLEMENT([GNULIB_TEST_WARN_CFLAGS],
+ [$GNULIB_WARN_CFLAGS], [$nw])
+ gl_WARN_ADD([-Wno-return-type], [GNULIB_TEST_WARN_CFLAGS])
+ AC_SUBST([GNULIB_TEST_WARN_CFLAGS])
fi
# By default, argmatch should fail calling usage (EXIT_FAILURE).