Avoid a gcc warning.
authorBruno Haible <bruno@clisp.org>
Sat, 24 Apr 2010 16:02:56 +0000 (18:02 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 24 Apr 2010 16:02:56 +0000 (18:02 +0200)
ChangeLog
tests/test-vasprintf.c

index 2d4a231..e3a6fc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-04-24  Bruno Haible  <bruno@clisp.org>
 
+       Avoid a gcc warning.
+       * tests/test-vasprintf.c (test_vasprintf, test_asprintf): Pass argument
+       of correct type for %08lx directive.
+       Reported by Eric Blake.
+
+2010-04-24  Bruno Haible  <bruno@clisp.org>
+
        vasnprintf: Correct errno value in case of out-of-memory.
        * lib/vasnprintf.c (VASNPRINTF): Set errno to 0 before calling SNPRINTF
        or sprintf. Use the errno value from SNPRINTF or sprintf.
@@ -36,7 +43,7 @@
 
 2010-04-21  Simon Josefsson  <simon@josefsson.org>
 
-       * tests/test-vasprintf.c: Test %08lx.
+       * tests/test-vasprintf.c (test_vasprintf, test_asprintf): Test %08lx.
 
 2010-04-20  Eric Blake  <eblake@redhat.com>
 
index e5676f4..cfde4f4 100644 (file)
@@ -60,7 +60,7 @@ test_vasprintf ()
   for (repeat = 0; repeat <= 8; repeat++)
     {
       char *result;
-      int retval = my_asprintf (&result, "%08lx", 12345);
+      int retval = my_asprintf (&result, "%08lx", 12345UL);
       ASSERT (retval == 8);
       ASSERT (result != NULL);
       ASSERT (strcmp (result, "00003039") == 0);
@@ -86,7 +86,7 @@ test_asprintf ()
   for (repeat = 0; repeat <= 8; repeat++)
     {
       char *result;
-      int retval = asprintf (&result, "%08lx", 12345);
+      int retval = asprintf (&result, "%08lx", 12345UL);
       ASSERT (retval == 8);
       ASSERT (result != NULL);
       ASSERT (strcmp (result, "00003039") == 0);