coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coreutils] [PATCH] build: prepare to enable -Werror also for gnulib-tes


From: Jim Meyering
Subject: [coreutils] [PATCH] build: prepare to enable -Werror also for gnulib-tests/
Date: Wed, 13 Oct 2010 11:33:01 +0200

With this change and a few that are pending ACKs in gnulib,
gnulib-tests/ compiles with -Werror.  Depending on when/how
the gnulib changes turn out, I may uncomment the use of
$(WERROR_CFLAGS) below before pushing this.

>From 71a3fd73a1fa005ee4ac969e57b43f90237656b9 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 13 Oct 2010 11:20:18 +0200
Subject: [PATCH] build: prepare to enable -Werror also for gnulib-tests/

* configure.ac (GNULIB_WARN_CFLAGS): Define new variable, for use
in gnulib-tests.
* gnulib-tests/Makefile.am: Disable specific -W___ options,
but only for a few specific offending tests:
(test_xvasprintf_CFLAGS): Define.
(test_lock_CFLAGS, test_tls_CFLAGS): Define.
---
 configure.ac             |    7 +++++++
 gnulib-tests/Makefile.am |   16 +++++++++++++++-
 2 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index acd397e..4ac30e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,6 +124,13 @@ if test "$gl_gcc_warnings" = yes; then
   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
diff --git a/gnulib-tests/Makefile.am b/gnulib-tests/Makefile.am
index c3a48e8..7ec0a1c 100644
--- a/gnulib-tests/Makefile.am
+++ b/gnulib-tests/Makefile.am
@@ -1,3 +1,17 @@
 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
--
1.7.3.1.104.gc752e



reply via email to

[Prev in Thread] Current Thread [Next in Thread]