summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--stdio-common/bug-vfprintf-nargs.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1a79665f7e..276e613d6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2014-12-17 Stefan Liebler <stli@linux.vnet.ibm.com>
+ * stdio-common/bug-vfprintf-nargs.c (do_test):
+ Cast value to intptr_t to avoid format warning
+ for usage with PRIdPTR printing macro.
+
+2014-12-17 Stefan Liebler <stli@linux.vnet.ibm.com>
+
* libio/tst-widetext.c (do_test):
Use format type %td instead of %Zd for ptrdiff_t
in order to avoid format warning.
diff --git a/stdio-common/bug-vfprintf-nargs.c b/stdio-common/bug-vfprintf-nargs.c
index c7e7f0b8b4..75349671a1 100644
--- a/stdio-common/bug-vfprintf-nargs.c
+++ b/stdio-common/bug-vfprintf-nargs.c
@@ -65,7 +65,8 @@ do_test (void)
test this on 32-bit systems. */
if (sizeof (long int) == 4)
{
- sprintf (buf, "%%1$d %%%" PRIdPTR "$d", UINT32_MAX / sizeof (int));
+ sprintf (buf, "%%1$d %%%" PRIdPTR "$d",
+ (intptr_t) (UINT32_MAX / sizeof (int)));
if (format_failed (buf, "1 %$d") != 0)
rc = 1;
}