about summary refs log tree commit diff
path: root/stdio-common
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-11-27 03:25:15 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-11-27 03:25:15 +0000
commitd88548f497e52ad7633db1f3243daef0ba9fe54b (patch)
treeb83e69a6702e80259914885d9770a470f658af37 /stdio-common
parentbe97091638d156a53009b4034c60b58eaf3efa24 (diff)
downloadglibc-d88548f497e52ad7633db1f3243daef0ba9fe54b.tar.gz
glibc-d88548f497e52ad7633db1f3243daef0ba9fe54b.tar.xz
glibc-d88548f497e52ad7633db1f3243daef0ba9fe54b.zip
Fix stdio-common/tst-fmemopen.c format warnings.
Testing for 32-bit x86 shows up warnings in
stdio-common/tst-fmemopen.c where off_t values are passed to %zu
printf formats.  Since the values are in messages relating to function
calls where the relevant argument is of type size_t, it seems most
appropriate to cast explicitly to size_t when passing to printf, which
this patch does.

Tested for 32-bit x86.

	* stdio-common/tst-fmemopen.c (do_test): Cast st_size values to
	size_t for %zu format.
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/tst-fmemopen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stdio-common/tst-fmemopen.c b/stdio-common/tst-fmemopen.c
index aba931070b..c5015a6f0e 100644
--- a/stdio-common/tst-fmemopen.c
+++ b/stdio-common/tst-fmemopen.c
@@ -108,13 +108,13 @@ do_test (void)
 				  MAP_SHARED, fd, 0)) == MAP_FAILED)
     {
       printf ("mmap (NULL, %zu, PROT_READ, MAP_SHARED, %i, 0) failed\n",
-	      fs.st_size, fd);
+	      (size_t) fs.st_size, fd);
       return 5;
     }
 
   if ((fp = fmemopen (mmap_data, fs.st_size, "r")) == NULL)
     {
-      printf ("fmemopen (%p, %zu) failed\n", mmap_data, fs.st_size);
+      printf ("fmemopen (%p, %zu) failed\n", mmap_data, (size_t) fs.st_size);
       return 1;
     }