I noticed these while trying to build m4 and diffutils:
From: Eric Blake <e...@byu.net> Date: Thu, 19 Nov 2009 08:51:13 -0700 Subject: [PATCH 1/2] text-xvasprintf: silence compiler warnings * tests/test-xvasprintf.c (test_xvasprintf, test_xasprintf): Mask empty string from gcc. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 6 ++++++ tests/test-xvasprintf.c | 24 ++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93ec669..9a868f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-19 Eric Blake <e...@byu.net> + + text-xvasprintf: silence compiler warnings + * tests/test-xvasprintf.c (test_xvasprintf, test_xasprintf): Mask + empty string from gcc. + 2009-11-17 Eric Blake <e...@byu.net> stdlib-safer: preserve cloexec flag for mkostemp[s] diff --git a/tests/test-xvasprintf.c b/tests/test-xvasprintf.c index 229e3fd..cc70709 100644 --- a/tests/test-xvasprintf.c +++ b/tests/test-xvasprintf.c @@ -65,10 +65,14 @@ test_xvasprintf (void) free (result); } - result = my_xasprintf (""); - ASSERT (result != NULL); - ASSERT (strcmp (result, "") == 0); - free (result); + { + /* Silence gcc warning about zero-length format string. */ + char *empty = ""; + result = my_xasprintf (empty); + ASSERT (result != NULL); + ASSERT (strcmp (result, "") == 0); + free (result); + } result = my_xasprintf ("%s", "foo"); ASSERT (result != NULL); @@ -100,10 +104,14 @@ test_xasprintf () free (result); } - result = xasprintf (""); - ASSERT (result != NULL); - ASSERT (strcmp (result, "") == 0); - free (result); + { + /* Silence gcc warning about zero-length format string. */ + char *empty = ""; + result = xasprintf (empty); + ASSERT (result != NULL); + ASSERT (strcmp (result, "") == 0); + free (result); + } result = xasprintf ("%s", "foo"); ASSERT (result != NULL); -- 1.6.4.2 >From e1659df56e80448785886a593583d35f91a75d40 Mon Sep 17 00:00:00 2001 From: Eric Blake <e...@byu.net> Date: Thu, 19 Nov 2009 09:12:34 -0700 Subject: [PATCH 2/2] xalloc-die-tests: add missing library * modules/xalloc-die-tests (Makefile.am): Add LDADD line. Signed-off-by: Eric Blake <e...@byu.net> --- ChangeLog | 3 +++ modules/xalloc-die-tests | 1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a868f5..ed9e8f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-11-19 Eric Blake <e...@byu.net> + xalloc-die-tests: add missing library + * modules/xalloc-die-tests (Makefile.am): Add LDADD line. + text-xvasprintf: silence compiler warnings * tests/test-xvasprintf.c (test_xvasprintf, test_xasprintf): Mask empty string from gcc. diff --git a/modules/xalloc-die-tests b/modules/xalloc-die-tests index ed6a470..9b430cb 100644 --- a/modules/xalloc-die-tests +++ b/modules/xalloc-die-tests @@ -8,3 +8,4 @@ Makefile.am: TESTS += test-xalloc-die.sh TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' check_PROGRAMS += test-xalloc-die +test_xalloc_die_LDADD = $(LDADD) @LIBINTL@ -- 1.6.4.2