summaryrefslogtreecommitdiff
path: root/gnulib-tests
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2010-12-22 01:48:27 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2010-12-22 01:48:54 -0800
commit056caf4857369fb7e549bc6e5cbfd997185e6019 (patch)
tree5e75af757d7cdd279b7229bdc5f9c2e08704a6f4 /gnulib-tests
parenta300cfd43ccb3f48f5110a2abf6fe234fece3dc3 (diff)
downloadcoreutils-056caf4857369fb7e549bc6e5cbfd997185e6019.tar.xz
tests: do not assume compiler knows -Wxxx flags
* gnulib-tests/Makefile.am (test_xvasprintf_CFLAGS): (test_lock_CFLAGS, test_tls_CFLAGS): Do not append GCC-specific flags like -Wno-format-security unless the GCC-specific flag -Werror is also specified. This avoids a "make check" failure on Solaris when using Sun C 5.8.
Diffstat (limited to 'gnulib-tests')
-rw-r--r--gnulib-tests/Makefile.am11
1 files changed, 7 insertions, 4 deletions
diff --git a/gnulib-tests/Makefile.am b/gnulib-tests/Makefile.am
index 9883a771d..311baf95c 100644
--- a/gnulib-tests/Makefile.am
+++ b/gnulib-tests/Makefile.am
@@ -3,15 +3,18 @@ include gnulib.mk
AM_CFLAGS = $(GNULIB_TEST_WARN_CFLAGS) $(WERROR_CFLAGS)
# A few tests are inherently warning-evoking.
-# Since we require -Werror, exempt the few offenders.
+# In the typical case where we use -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_xvasprintf_CFLAGS = $(AM_CFLAGS) \
+ `test X$(WERROR_CFLAGS) = X || echo ' -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
+test_lock_CFLAGS = $(AM_CFLAGS) \
+ `test X$(WERROR_CFLAGS) = X || echo ' -Wno-bad-function-cast'`
+test_tls_CFLAGS = $(AM_CFLAGS) \
+ `test X$(WERROR_CFLAGS) = X || echo ' -Wno-bad-function-cast'`