From: Eric Blake Date: Fri, 8 Jul 2011 21:57:31 +0000 (-0600) Subject: test-snprintf: avoid compiler warning X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71af89e818c5673a6b3ded7f9dbd78015222fb90;p=pspp test-snprintf: avoid compiler warning * tests/test-snprintf.c (main): Avoid shadowed declaration. * tests/test-vsnprintf.c (main): Likewise. Reported by Jim Meyering. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 465ccafe98..2465f4c04d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-07-08 Eric Blake + + test-snprintf: avoid compiler warning + * tests/test-snprintf.c (main): Avoid shadowed declaration. + * tests/test-vsnprintf.c (main): Likewise. + Reported by Jim Meyering. + 2011-07-08 Bruno Haible Tests for module 'pthread_sigmask'. diff --git a/tests/test-snprintf.c b/tests/test-snprintf.c index 18efed5185..2b5a54c4af 100644 --- a/tests/test-snprintf.c +++ b/tests/test-snprintf.c @@ -63,7 +63,7 @@ main (int argc, char *argv[]) /* Test the support of the POSIX/XSI format strings with positions. */ { char result[100]; - int retval = snprintf (result, sizeof (result), "%2$d %1$d", 33, 55); + retval = snprintf (result, sizeof (result), "%2$d %1$d", 33, 55); ASSERT (strcmp (result, "55 33") == 0); ASSERT (retval == strlen (result)); } diff --git a/tests/test-vsnprintf.c b/tests/test-vsnprintf.c index 6711f39b6a..7a520824bb 100644 --- a/tests/test-vsnprintf.c +++ b/tests/test-vsnprintf.c @@ -76,7 +76,7 @@ main (int argc, char *argv[]) /* Test the support of the POSIX/XSI format strings with positions. */ { char result[100]; - int retval = my_snprintf (result, sizeof (result), "%2$d %1$d", 33, 55); + retval = my_snprintf (result, sizeof (result), "%2$d %1$d", 33, 55); ASSERT (strcmp (result, "55 33") == 0); ASSERT (retval == strlen (result)); }