nw="$nw -Wold-style-definition"
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"
+ gl_MANYWARN_COMPLEMENT([GNULIB_TEST_WARN_CFLAGS],
+ [$GNULIB_WARN_CFLAGS], [$nw])
+ AC_SUBST([GNULIB_TEST_WARN_CFLAGS])
fi
AC_FUNC_FORK
include gnulib.mk
-AM_CFLAGS = $(GNULIB_WARN_CFLAGS) # $(WERROR_CFLAGS)
+AM_CFLAGS = $(GNULIB_TEST_WARN_CFLAGS) # $(WERROR_CFLAGS)
+
+# A few tests are inherently warning-evoking.
+# Since we require -Werror, exempt the few offenders.
+
+# test-xvasprintf.c: In function 'test_xasprintf':
+# test-xvasprintf.c:100: error: format not a string literal and no \
+# format arguments [-Wformat-security]
+test_xvasprintf_CFLAGS = $(AM_CFLAGS) -Wno-format-security
+
+# test-lock.c: In function 'lock_mutator_thread':
+# test-lock.c:148: error: cast from function call of type 'pthread_t' to \
+# non-matching type 'void *' [-Wbad-function-cast]
+test_lock_CFLAGS = $(AM_CFLAGS) -Wno-bad-function-cast
+test_tls_CFLAGS = $(AM_CFLAGS) -Wno-bad-function-cast