about summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>2022-09-01 10:02:30 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-09-22 08:48:04 -0300
commitde477abcaaabb1f9815cb63876637a47a95e7ac1 (patch)
tree22bd98fe9a4aaa03257147db719e844fcdb42f7a /libio
parent340097d0b50eff9d3058e06c6989ae398c653d4a (diff)
downloadglibc-de477abcaaabb1f9815cb63876637a47a95e7ac1.tar.gz
glibc-de477abcaaabb1f9815cb63876637a47a95e7ac1.tar.xz
glibc-de477abcaaabb1f9815cb63876637a47a95e7ac1.zip
Use '%z' instead of '%Z' on printf functions
The Z modifier is a nonstandard synonymn for z (that predates z
itself) and compiler might issue an warning for in invalid
conversion specifier.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'libio')
-rw-r--r--libio/tst-ext.c8
-rw-r--r--libio/tst-widetext.c10
-rw-r--r--libio/tst_swprintf.c6
-rw-r--r--libio/tst_swscanf.c4
4 files changed, 14 insertions, 14 deletions
diff --git a/libio/tst-ext.c b/libio/tst-ext.c
index f69fbe6f21..c987b1bafc 100644
--- a/libio/tst-ext.c
+++ b/libio/tst-ext.c
@@ -25,8 +25,8 @@ main (void)
   /* Get the buffer size.  */
   if (__fbufsize (fp) != sizeof buf)
     {
-      printf ("__fbusize() reported a buffer size of %Zd bytes;"
-	      " we installed a buffer with %Zd bytes\n",
+      printf ("__fbusize() reported a buffer size of %zd bytes;"
+	      " we installed a buffer with %zd bytes\n",
 	      __fbufsize (fp), sizeof buf);
       result = 1;
     }
@@ -91,7 +91,7 @@ main (void)
   /* The string we wrote above should still be in the buffer.  */
   if (__fpending (fp) != strlen (teststring))
     {
-      printf ("__fpending() returned %Zd; expected %Zd\n",
+      printf ("__fpending() returned %zd; expected %zd\n",
 	      __fpending (fp), strlen (teststring));
       result = 1;
     }
@@ -100,7 +100,7 @@ main (void)
   /* And check again.  */
   if (__fpending (fp) != 0)
     {
-      printf ("__fpending() returned %Zd; expected 0\n",
+      printf ("__fpending() returned %zd; expected 0\n",
 	      __fpending (fp));
       result = 1;
     }
diff --git a/libio/tst-widetext.c b/libio/tst-widetext.c
index f1616bfb28..df9e965029 100644
--- a/libio/tst-widetext.c
+++ b/libio/tst-widetext.c
@@ -59,7 +59,7 @@ do_test (void)
       exit (1);
     }
 
-   printf ("INFO: input file has %Zd bytes\n", mbsize);
+   printf ("INFO: input file has %zd bytes\n", mbsize);
 
   /* First convert the text to wide characters.  We use iconv here.  */
   {
@@ -82,7 +82,7 @@ do_test (void)
     nonr = iconv (cd, &inbuf, &inleft, &outbuf, &outleft);
     if (nonr != 0 && nonr != (size_t) -1)
       {
-	printf ("%u: iconv performed %Zd nonreversible conversions\n",
+	printf ("%u: iconv performed %zd nonreversible conversions\n",
 		__LINE__, nonr);
 	exit (1);
       }
@@ -90,7 +90,7 @@ do_test (void)
     if  (nonr == (size_t) -1)
       {
 	printf ("\
-%u: iconv returned with %Zd and errno = %m (inleft: %Zd, outleft: %Zd)\n",
+%u: iconv returned with %zd and errno = %m (inleft: %zd, outleft: %zd)\n",
 		__LINE__, nonr, inleft, outleft);
 	exit (1);
       }
@@ -163,7 +163,7 @@ do_test (void)
       wint_t wch = fgetwc (fp);
       if (wch == WEOF)
 	{
-	  printf ("%u: fgetwc failed (idx %Zd): %m\n", __LINE__, n);
+	  printf ("%u: fgetwc failed (idx %zd): %m\n", __LINE__, n);
 	  exit (1);
 	}
       wc2buf[n] = wch;
@@ -290,7 +290,7 @@ do_test (void)
     {
       if (fgetws (wcp, &wc2buf[wcsize] - wcp + 1, fp) == NULL)
 	{
-	  printf ("%u: short read using fgetws (only %td of %Zd)\n",
+	  printf ("%u: short read using fgetws (only %td of %zd)\n",
 		  __LINE__, wcp - wc2buf, wcsize);
 	  status = 1;
 	  break;
diff --git a/libio/tst_swprintf.c b/libio/tst_swprintf.c
index 8a2ffe60ec..1f997b9393 100644
--- a/libio/tst_swprintf.c
+++ b/libio/tst_swprintf.c
@@ -42,18 +42,18 @@ do_test (void)
       if (tests[n].exp < 0 && res >= 0)
 	{
 	  support_record_failure ();
-	  printf ("swprintf (buf, %Zu, L\"%%s\", \"%s\") expected to fail\n",
+	  printf ("swprintf (buf, %zu, L\"%%s\", \"%s\") expected to fail\n",
 		  tests[n].n, tests[n].str);
 	}
       else if (tests[n].exp >= 0 && tests[n].exp != res)
 	{
 	  support_record_failure ();
 	  printf ("\
-swprintf (buf, %Zu, L\"%%s\", \"%s\") expected to return %Zd, but got %Zd\n",
+swprintf (buf, %zu, L\"%%s\", \"%s\") expected to return %zd, but got %zd\n",
 		  tests[n].n, tests[n].str, tests[n].exp, res);
 	}
       else
-	printf ("swprintf (buf, %Zu, L\"%%s\", \"%s\") OK\n",
+	printf ("swprintf (buf, %zu, L\"%%s\", \"%s\") OK\n",
 		tests[n].n, tests[n].str);
     }
 
diff --git a/libio/tst_swscanf.c b/libio/tst_swscanf.c
index 372f0fc7d3..5d3582efd1 100644
--- a/libio/tst_swscanf.c
+++ b/libio/tst_swscanf.c
@@ -20,7 +20,7 @@ main (int argc, char *argv[])
   n = swscanf (in, L"%d + %d is %d", &a, &b, &c);
   if (n != 3 || a + b != c || c != 42)
     {
-      printf ("*** FAILED, n = %Zu, a = %d, b = %d, c = %d\n", n, a, b, c);
+      printf ("*** FAILED, n = %zu, a = %d, b = %d, c = %d\n", n, a, b, c);
       result = 1;
     }
 
@@ -30,7 +30,7 @@ main (int argc, char *argv[])
   if (n != 5 || strcmp (buf1, "one") != 0 || wcscmp (wbuf2, L"two") != 0
       || strcmp (buf3, "three") != 0 || c4 != '!' || wc5 != L'!')
     {
-      printf ("*** FAILED, n = %Zu, buf1 = \"%s\", wbuf2 = L\"%S\", buf3 = \"%s\", c4 = '%c', wc5 = L'%C'\n",
+      printf ("*** FAILED, n = %zu, buf1 = \"%s\", wbuf2 = L\"%S\", buf3 = \"%s\", c4 = '%c', wc5 = L'%C'\n",
 	      n, buf1, wbuf2, buf3, c4, (wint_t) wc5);
       result = 1;
     }