]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use '%z' instead of '%Z' on printf functions
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Thu, 1 Sep 2022 13:02:30 +0000 (10:02 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 22 Sep 2022 11:48:04 +0000 (08:48 -0300)
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>
29 files changed:
catgets/gencat.c
elf/dl-load.c
elf/dl-printf.c
elf/dl-tunables.c
elf/rtld.c
elf/sprof.c
elf/tst-dlmodcount.c
elf/tst-tls-dlinfo.c
gmon/tst-sprofil.c
iconv/iconv_charmap.c
libio/tst-ext.c
libio/tst-widetext.c
libio/tst_swprintf.c
libio/tst_swscanf.c
locale/programs/ld-collate.c
locale/programs/ld-ctype.c
localedata/bug-iconv-trans.c
localedata/tst-iconv-math-trans.c
math/test-tgmath-ret.c
nptl/tst-rwlock6.c
nptl/tst-rwlock7.c
posix/runptests.c
posix/wordexp-test.c
rt/tst-aio.c
rt/tst-aio64.c
string/tester.c
string/tst-strlen.c
time/tst-strftime.c
wcsmbs/wcsmbs-tst1.c

index cebf1fd4358ba207f2e623f18d7c924c07635a62..dec4d936a7c08f53c1685eb6bb119395e176f10e 100644 (file)
@@ -1033,7 +1033,7 @@ write_out (struct catalog *catalog, const char *output_name,
          /* If the current message set has a symbolic name write this
             out first.  */
          if (set_run->symbol != NULL)
-           fprintf (fp, "%s#define %sSet %#x\t/* %s:%Zu */\n",
+           fprintf (fp, "%s#define %sSet %#x\t/* %s:%zu */\n",
                     first ? "" : "\n", set_run->symbol, set_run->number - 1,
                     set_run->fname, set_run->line);
          first = 0;
@@ -1047,12 +1047,12 @@ write_out (struct catalog *catalog, const char *output_name,
              if (message_run->symbol != NULL)
                {
                  if (set_run->symbol == NULL)
-                   fprintf (fp, "#define AutomaticSet%d%s %#x\t/* %s:%Zu */\n",
+                   fprintf (fp, "#define AutomaticSet%d%s %#x\t/* %s:%zu */\n",
                             set_run->number, message_run->symbol,
                             message_run->number, message_run->fname,
                             message_run->line);
                  else
-                   fprintf (fp, "#define %s%s %#x\t/* %s:%Zu */\n",
+                   fprintf (fp, "#define %s%s %#x\t/* %s:%zu */\n",
                             set_run->symbol, message_run->symbol,
                             message_run->number, message_run->fname,
                             message_run->line);
index 1ad0868dad809d56c7ecced65ce482af4982abc9..911db4c9063abb0547969e1f73970df5d068b284 100644 (file)
@@ -1406,7 +1406,7 @@ cannot enable executable stack as shared object requires");
 
   if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
     _dl_debug_printf ("\
-  dynamic: 0x%0*lx  base: 0x%0*lx   size: 0x%0*Zx\n\
+  dynamic: 0x%0*lx  base: 0x%0*lx   size: 0x%0*zx\n\
     entry: 0x%0*lx  phdr: 0x%0*lx  phnum:   %*u\n\n",
                           (int) sizeof (void *) * 2,
                           (unsigned long int) l->l_ld,
index d3264ba96cd959bf3571791d83e3a8ebb73c3f58..429d2e80c2b7defdbc54328bad9589aa3fab43f4 100644 (file)
@@ -113,7 +113,7 @@ _dl_debug_vdprintf (int fd, int tag_p, const char *fmt, va_list arg)
          /* Recognize the l modifier.  It is only important on some
             platforms where long and int have a different size.  We
             can use the same code for size_t.  */
-         if (*fmt == 'l' || *fmt == 'Z')
+         if (*fmt == 'l' || *fmt == 'z')
            {
 #if LONG_MAX != INT_MAX
              long_mod = 1;
index 8e7ee9df1049576f4c379d7955106e7811bfc216..a3e399fda2504890ceab317925881291cd724a5b 100644 (file)
@@ -380,7 +380,7 @@ __tunables_print (void)
                          (long int) cur->type.max);
              break;
            case TUNABLE_TYPE_SIZE_T:
-             _dl_printf ("0x%Zx (min: 0x%Zx, max: 0x%Zx)\n",
+             _dl_printf ("0x%zx (min: 0x%zx, max: 0x%zx)\n",
                          (size_t) cur->val.numval,
                          (size_t) cur->type.min,
                          (size_t) cur->type.max);
index 3e771a93d83457665d0e143cf6c22ace592ec6ac..3b78f405623b1e629b4a7440789fdbc10d7acf1a 100644 (file)
@@ -2125,11 +2125,11 @@ dl_main (const ElfW(Phdr) *phdr,
            else if (strcmp (l->l_libname->name, l->l_name) == 0)
              /* Print vDSO like libraries without duplicate name.  Some
                 consumers depend of this format.  */
-             _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name,
+             _dl_printf ("\t%s (0x%0*zx)\n", l->l_libname->name,
                          (int) sizeof l->l_map_start * 2,
                          (size_t) l->l_map_start);
            else
-             _dl_printf ("\t%s => %s (0x%0*Zx)\n",
+             _dl_printf ("\t%s => %s (0x%0*zx)\n",
                          DSO_FILENAME (l->l_libname->name),
                          DSO_FILENAME (l->l_name),
                          (int) sizeof l->l_map_start * 2,
@@ -2151,7 +2151,7 @@ dl_main (const ElfW(Phdr) *phdr,
 
            loadbase = LOOKUP_VALUE_ADDRESS (result, false);
 
-           _dl_printf ("%s found at 0x%0*Zd in object at 0x%0*Zd\n",
+           _dl_printf ("%s found at 0x%0*zd in object at 0x%0*zd\n",
                        _dl_argv[i],
                        (int) sizeof ref->st_value * 2,
                        (size_t) ref->st_value,
index 405fbcbf3874c0ec11f39c3730163d238d26de0c..da7d817b09d5f13868a1952998ba3ae085bff8ca 100644 (file)
@@ -476,7 +476,7 @@ load_shobj (const char *name)
   result->kcountsize = textsize / HISTFRACTION;
   result->hashfraction = HASHFRACTION;
   if (do_test)
-    printf ("hashfraction = %d\ndivider = %Zu\n",
+    printf ("hashfraction = %d\ndivider = %zu\n",
            result->hashfraction,
            result->hashfraction * sizeof (struct here_fromstruct));
   result->tossize = textsize / HASHFRACTION;
@@ -495,7 +495,7 @@ load_shobj (const char *name)
                              * sizeof (struct here_cg_arc_record)));
 
   if (do_test)
-    printf ("expected size: %Zd\n", result->expected_size);
+    printf ("expected size: %zd\n", result->expected_size);
 
 #define SCALE_1_TO_1   0x10000L
 
@@ -1357,15 +1357,15 @@ generate_call_graph (struct profdata *profdata)
                     ? sortsym[runp->idx]->name : "<UNKNOWN>"));
 
            if (runp->idx != (size_t) -1l)
-             printf (" [%Zd]", runp->idx);
+             printf (" [%zd]", runp->idx);
            putchar_unlocked ('\n');
 
            runp = runp->next;
          }
 
        /* Info about the function itself.  */
-       n = printf ("[%Zu]", cnt);
-       printf ("%*s%5.1f%8.2f%8.2f%9" PRIdMAX "         %s [%Zd]\n",
+       n = printf ("[%zu]", cnt);
+       printf ("%*s%5.1f%8.2f%8.2f%9" PRIdMAX "         %s [%zd]\n",
                (int) (7 - n), " ",
                total_ticks ? (100.0 * sortsym[cnt]->ticks) / total_ticks : 0,
                sortsym[cnt]->ticks * tick_unit,
@@ -1384,7 +1384,7 @@ generate_call_graph (struct profdata *profdata)
                    runp->count);
 
            if (runp->idx != (size_t) -1l)
-             printf ("%-9" PRIdMAX "   %s [%Zd]\n",
+             printf ("%-9" PRIdMAX "   %s [%zd]\n",
                      sortsym[runp->idx]->calls,
                      sortsym[runp->idx]->name,
                      runp->idx);
index 8a96803d8589c529fb8b145df506786f858d2fe4..d5f89b8f7937710be8d8bb4f849e6d2dded6df0a 100644 (file)
@@ -32,7 +32,7 @@ callback (struct dl_phdr_info *info, size_t size, void *ptr)
   static int last_adds = 0, last_subs = 0;
   intptr_t cmd = (intptr_t) ptr;
 
-  printf ("  size = %Zu\n", size);
+  printf ("  size = %zu\n", size);
   if (size < (offsetof (struct dl_phdr_info, dlpi_subs)
              + sizeof (info->dlpi_subs)))
     {
index 7d2b42e2ab4d83defbaf3e57e86ff1d9f370820b..6d032bdc53d0fa199786e2a4d12d73cdcb9c020c 100644 (file)
@@ -33,7 +33,7 @@ do_test (void)
       result = 1;
     }
   else
-    printf ("dlinfo says TLS module ID %Zu\n", modid);
+    printf ("dlinfo says TLS module ID %zu\n", modid);
 
   void *block;
   if (dlinfo (h, RTLD_DI_TLS_DATA, &block))
index a927e737b2d23813bccef4d38ecd6313bf28b79a..de5a4e5198c5a054fb9b3eca71b3d27c4a6db228 100644 (file)
@@ -161,7 +161,7 @@ main (int argc, char **argv)
   for (i = 0; i < NELEMS (taddr); ++i)
     for (j = 0; j < 0x10000 / sizeof (int); ++j)
       if (buf[i][j] != 0)
-       printf ("%0*Zx\t%u\t(buffer %d)\n",
+       printf ("%0*zx\t%u\t(buffer %d)\n",
                (int) (sizeof (size_t) * 2),
                (taddr[i] + ((char *) &buf[i][j] - (char *) &buf[i][0])),
                buf[i][j], i);
index 1992937d6e2d14630e319bbe76133ec2e41a8af8..98c7649870d6ac14fd1107c1f9f118c150a24543 100644 (file)
@@ -440,7 +440,7 @@ process_block (struct convtable *tbl, char *addr, size_t len, FILE *output)
               ignoring errors.  Otherwise punt.  */
            if (! omit_invalid)
              {
-               error (0, 0, _("illegal input sequence at position %Zd"), n);
+               error (0, 0, _("illegal input sequence at position %zd"), n);
                return -1;
              }
 
index f69fbe6f21cd91ca311de5000b199be642646b4f..c987b1bafc726880afbf1a12e77ea2bf4eb7e004 100644 (file)
@@ -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;
     }
index f1616bfb28a90f23d82f031509c712cda2552496..df9e9650292ed12a1aeacb6f4b3a678e3ec442a7 100644 (file)
@@ -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;
index 8a2ffe60ecf208b41d1b6ad4cf7c0593b976a8bc..1f997b939371da951e57fdd6d7eb80c0d5a76aa3 100644 (file)
@@ -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);
     }
 
index 372f0fc7d3214dbbfb88e8f7d631edacf913b204..5d3582efd1ab60c8f12daca2a24aea881ee98312 100644 (file)
@@ -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;
     }
index 992814491d2a5e2321786844f1d7930aa3b5e54b..c790623cbc55b1af7429feb059e8b018e19a616d 100644 (file)
@@ -1059,7 +1059,7 @@ insert_value (struct linereader *ldfile, const char *symstr, size_t symlen,
   /* Test whether this element is not already in the list.  */
   if (elem->next != NULL || elem == collate->cursor)
     {
-      lr_error (ldfile, _("order for `%.*s' already defined at %s:%Zu"),
+      lr_error (ldfile, _("order for `%.*s' already defined at %s:%zu"),
                (int) symlen, symstr, elem->file, elem->line);
       lr_ignore_rest (ldfile, 0);
       return 1;
@@ -1235,7 +1235,7 @@ range is not lower than that of the last character"), "LC_COLLATE");
                                             && elem->next == collate->cursor))
                    {
                      lr_error (ldfile, _("\
-order for `%.*s' already defined at %s:%Zu"),
+order for `%.*s' already defined at %s:%zu"),
                                (int) namelen, seq->name,
                                elem->file, elem->line);
                      goto increment;
@@ -1378,7 +1378,7 @@ order for `%.*s' already defined at %s:%Zu"),
                                             && elem->next == collate->cursor))
                    {
                      lr_error (ldfile, _("\
-%s: order for `%.*s' already defined at %s:%Zu"),
+%s: order for `%.*s' already defined at %s:%zu"),
                                "LC_COLLATE", (int) lenfrom, buf,
                                elem->file, elem->line);
                      continue;
@@ -3728,7 +3728,7 @@ error while adding equivalent collating symbol"));
              || &collate->undefined == collate->cursor)
            {
              lr_error (ldfile,
-                       _("%s: order for `%.*s' already defined at %s:%Zu"),
+                       _("%s: order for `%.*s' already defined at %s:%zu"),
                        "LC_COLLATE", 9, "UNDEFINED",
                        collate->undefined.file,
                        collate->undefined.line);
index c6749dbd82212105cf617df86c2b3f4e59138722..e85820d3357ce44d3fb260a42c62f978a4dd2e4f 100644 (file)
@@ -526,7 +526,7 @@ internal error in %s, line %u"), __FUNCTION__, __LINE__);
                          {
                            char buf[17];
 
-                           snprintf (buf, sizeof buf, "\\%Zo", cnt);
+                           snprintf (buf, sizeof buf, "\\%zo", cnt);
 
                            record_error (0, 0, _("\
 character '%s' in class `%s' must be in class `%s'"),
@@ -541,7 +541,7 @@ character '%s' in class `%s' must be in class `%s'"),
                          {
                            char buf[17];
 
-                           snprintf (buf, sizeof buf, "\\%Zo", cnt);
+                           snprintf (buf, sizeof buf, "\\%zo", cnt);
 
                            record_error (0, 0, _("\
 character '%s' in class `%s' must not be in class `%s'"),
index 3886247c387c09208a27f9cade910595036262a3..f1a0416547afedb91b5d62d7575a7646159b07e7 100644 (file)
@@ -36,7 +36,7 @@ main (void)
       if (n == (size_t) -1)
        printf ("iconv() returned error: %m\n");
       else
-       printf ("iconv() returned %Zd, expected 7\n", n);
+       printf ("iconv() returned %zd, expected 7\n", n);
       result = 1;
     }
   if (inlen != 0)
@@ -57,7 +57,7 @@ main (void)
     }
   else if (outlen != sizeof (outbuf) - sizeof (expected))
     {
-      printf ("outlen wrong: %Zd, expected %Zd\n", outlen,
+      printf ("outlen wrong: %zd, expected %zd\n", outlen,
              sizeof (outbuf) - 15);
       result = 1;
     }
index a2d01a7e34f9cf166162de613b2144c7c561994d..34c62eb772d6d8dea487ca288e83022cdc4ed073 100644 (file)
@@ -70,7 +70,7 @@ do_test (void)
       if (n == (size_t) -1)
         printf ("iconv() returned error: %m\n");
       else
-        printf ("iconv() returned %Zd, expected 24\n", n);
+        printf ("iconv() returned %zd, expected 24\n", n);
       result = 1;
     }
   if (inlen != 0)
@@ -91,7 +91,7 @@ do_test (void)
     }
   else if (outlen != sizeof (outbuf) - sizeof (expected))
     {
-      printf ("outlen wrong: %Zd, expected %Zd\n", outlen,
+      printf ("outlen wrong: %zd, expected %zd\n", outlen,
               sizeof (outbuf) - 15);
       result = 1;
     }
index 8c1cce37bd0c69918ab8c0f483821d16f64ca45d..dd054bef7e664e3c5f82e8f33d9ad34cc2723481 100644 (file)
@@ -83,7 +83,7 @@ do_test (void)
   check_return_fromfpx ();
   check_return_ufromfpx ();
 
-  printf ("%Zd\n", sizeof (carg (lx)));
+  printf ("%zd\n", sizeof (carg (lx)));
 
   return errors != 0;
 }
index 8294868f3b1e31c63a9e92c9b30cc79643c91921..acf36098eba55aaf32c4b90152336c8266058927 100644 (file)
@@ -104,16 +104,16 @@ do_test_clock (clockid_t clockid, const char *fnname)
       pthread_rwlockattr_t a;
 
       if (pthread_rwlockattr_init (&a) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlockattr_t failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlockattr_t failed\n", cnt);
 
       if (pthread_rwlockattr_setkind_np (&a, kind[cnt]) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlockattr_setkind failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlockattr_setkind failed\n", cnt);
 
       if (pthread_rwlock_init (&r, &a) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlock_init failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlock_init failed\n", cnt);
 
       if (pthread_rwlockattr_destroy (&a) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlockattr_destroy failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlockattr_destroy failed\n", cnt);
 
       struct timespec ts;
       xclock_gettime (clockid_for_get, &ts);
@@ -124,7 +124,7 @@ do_test_clock (clockid_t clockid, const char *fnname)
        ? pthread_rwlock_timedwrlock (&r, &ts)
        : pthread_rwlock_clockwrlock (&r, clockid, &ts);
       if (e != 0)
-        FAIL_EXIT1 ("round %Zu: %swrlock failed (%d)\n",
+        FAIL_EXIT1 ("round %zu: %swrlock failed (%d)\n",
                     cnt, fnname, e);
 
       verbose_printf ("1st %swrlock done\n", fnname);
@@ -160,7 +160,7 @@ do_test_clock (clockid_t clockid, const char *fnname)
       puts ("joined thread");
 
       if (pthread_rwlock_destroy (&r) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlock_destroy failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlock_destroy failed\n", cnt);
     }
 
   return 0;
index a228009a923d565286acbaf3cd5081e9c41faac8..7427bf8e2085bcd9aeebd91a250bbd8096f3f4d2 100644 (file)
@@ -100,16 +100,16 @@ do_test_clock (clockid_t clockid, const char *fnname)
       pthread_rwlockattr_t a;
 
       if (pthread_rwlockattr_init (&a) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlockattr_t failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlockattr_t failed\n", cnt);
 
       if (pthread_rwlockattr_setkind_np (&a, kind[cnt]) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlockattr_setkind failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlockattr_setkind failed\n", cnt);
 
       if (pthread_rwlock_init (&r, &a) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlock_init failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlock_init failed\n", cnt);
 
       if (pthread_rwlockattr_destroy (&a) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlockattr_destroy failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlockattr_destroy failed\n", cnt);
 
       struct timespec ts;
       xclock_gettime (clockid_for_get, &ts);
@@ -119,10 +119,10 @@ do_test_clock (clockid_t clockid, const char *fnname)
       /* Get a read lock.  */
       if (clockid == CLOCK_USE_TIMEDLOCK) {
         if (pthread_rwlock_timedrdlock (&r, &ts) != 0)
-          FAIL_EXIT1 ("round %Zu: rwlock_timedrdlock failed\n", cnt);
+          FAIL_EXIT1 ("round %zu: rwlock_timedrdlock failed\n", cnt);
       } else {
         if (pthread_rwlock_clockrdlock (&r, clockid, &ts) != 0)
-          FAIL_EXIT1 ("round %Zu: rwlock_%srdlock failed\n", cnt, fnname);
+          FAIL_EXIT1 ("round %zu: rwlock_%srdlock failed\n", cnt, fnname);
       }
 
       printf ("%zu: got %srdlock\n", cnt, fnname);
@@ -134,10 +134,10 @@ do_test_clock (clockid_t clockid, const char *fnname)
       pthread_t th = xpthread_create (NULL, tf, &args);
       void *status = xpthread_join (th);
       if (status != NULL)
-        FAIL_EXIT1 ("failure in round %Zu\n", cnt);
+        FAIL_EXIT1 ("failure in round %zu\n", cnt);
 
       if (pthread_rwlock_destroy (&r) != 0)
-        FAIL_EXIT1 ("round %Zu: rwlock_destroy failed\n", cnt);
+        FAIL_EXIT1 ("round %zu: rwlock_destroy failed\n", cnt);
     }
 
   return 0;
index ded47324ce2475349c94236186444769e3209956..6dfd3a4a1ad14602096f0f7a7599fc165fbb5a93 100644 (file)
@@ -115,7 +115,7 @@ main (int argc, char *argv[])
        regfree (&re);
       }
 
-  printf ("\n%Zu tests, %d errors\n", cnt, errors);
+  printf ("\n%zu tests, %d errors\n", cnt, errors);
 
   return errors != 0;
 }
index 0a36e0a7a37c0d562ba9704a0b28f32e5d6e5394..e330a0c3e789a92a9f15e4435868503813453754 100644 (file)
@@ -413,11 +413,11 @@ testit (struct test_case_struct *tc)
   if (bzzzt)
     {
       printf ("FAILED\n");
-      printf ("info: Test words: <%s>, need retval %d, wordc %Zd\n",
+      printf ("info: Test words: <%s>, need retval %d, wordc %zd\n",
              tc->words, tc->retval, tc->wordc);
       if (start_offs != 0)
        printf ("(preceded by %d NULLs)\n", start_offs);
-      printf ("Got retval %d, wordc %Zd: ", retval, we.we_wordc);
+      printf ("Got retval %d, wordc %zd: ", retval, we.we_wordc);
       if (retval == 0 || retval == WRDE_NOSPACE)
        {
          for (i = 0; i < we.we_wordc + start_offs; ++i)
index 62a1dee78fcde9c9c80b6c8d3e3ed443e91a9bb0..c7e9cd55ee3be979c687a1f835f928d18ad8e703 100644 (file)
@@ -274,7 +274,7 @@ do_test (int argc, char *argv[])
   for (cnt = 10; cnt > 0; )
     if (aio_cancel (fd, cbp[--cnt]) == -1)
       /* This is not an error.  The request can simply be finished.  */
-      printf ("aio_cancel (fd, cbp[%Zd]) cannot be canceled\n", cnt);
+      printf ("aio_cancel (fd, cbp[%zd]) cannot be canceled\n", cnt);
   puts ("finished2");
 
   result |= do_wait (cbp, 10, ECANCELED);
index 89129160ab65401c68c697209325d96edc5d66ec..f598ac097db2988f2cc4b270d8bc9c43fb0ef3c6 100644 (file)
@@ -275,7 +275,7 @@ do_test (int argc, char *argv[])
   for (cnt = 10; cnt > 0; )
     if (aio_cancel64 (fd, cbp[--cnt]) == -1)
       /* This is not an error.  The request can simply be finished.  */
-      printf ("aio_cancel64 (fd, cbp[%Zd]) cannot be canceled\n", cnt);
+      printf ("aio_cancel64 (fd, cbp[%zd]) cannot be canceled\n", cnt);
   puts ("finished2");
 
   result |= do_wait (cbp, 10, ECANCELED);
index 5a397055b10b6a4132f2b134fb38c1ab17e02b1e..eed76239f5e54cd86c83d050c313783fa82845d5 100644 (file)
@@ -1647,7 +1647,7 @@ main (void)
   else
     {
       status = EXIT_FAILURE;
-      printf("%Zd errors.\n", errors);
+      printf("%zd errors.\n", errors);
     }
 
   return status;
index 15fbc8bd7b095958e0a8d6e4b8540d4079094d54..5ec411c0df89b43e1018ece5e4b3ef615ea22b8a 100644 (file)
@@ -34,7 +34,7 @@ do_test (void)
              if (strlen (buf) != words * 4 + lens[last])
                {
                  printf ("\
-strlen failed for base=%Zu, words=%Zu, and last=%Zu (is %zd, expected %zd)\n",
+strlen failed for base=%zu, words=%zu, and last=%zu (is %zd, expected %zd)\n",
                          base, words, last,
                          strlen (buf), words * 4 + lens[last]);
                  return 1;
@@ -43,7 +43,7 @@ strlen failed for base=%Zu, words=%Zu, and last=%Zu (is %zd, expected %zd)\n",
              if (strnlen (buf, -1) != words * 4 + lens[last])
                {
                  printf ("\
-strnlen failed for base=%Zu, words=%Zu, and last=%Zu (is %zd, expected %zd)\n",
+strnlen failed for base=%zu, words=%zu, and last=%zu (is %zd, expected %zd)\n",
                          base, words, last,
                          strnlen (buf, -1), words * 4 + lens[last]);
                  return 1;
index af3ff72faf9588126fb269b0e9080357c32b5fcb..482cd16c39c4350af720755c1b23921d1197a0bb 100644 (file)
@@ -102,18 +102,18 @@ do_test (void)
 
       if (res == 0)
        {
-         printf ("%Zu: %s: res == 0 despite size == %Zu\n",
+         printf ("%zu: %s: res == 0 despite size == %zu\n",
                  cnt, tests[cnt].fmt, size);
          result = 1;
        }
       else if (size < tests[cnt].min)
        {
-         printf ("%Zu: %s: size == %Zu was enough\n",
+         printf ("%zu: %s: size == %zu was enough\n",
                  cnt, tests[cnt].fmt, size);
          result = 1;
        }
       else
-       printf ("%Zu: %s: size == %Zu: OK\n", cnt, tests[cnt].fmt, size);
+       printf ("%zu: %s: size == %zu: OK\n", cnt, tests[cnt].fmt, size);
 
       free (buf);
     }
index 0d0e18f63a180af201338973565e5d12e50c8b25..75b745af0423e0102106347d0f0955311f940576 100644 (file)
@@ -20,7 +20,7 @@ main (void)
 
   pchar = setlocale (LC_ALL, "de_DE.UTF-8");
   printf ("locale : %s\n",pchar);
-  printf ("MB_CUR_MAX %Zd\n", MB_CUR_MAX);
+  printf ("MB_CUR_MAX %zd\n", MB_CUR_MAX);
 
   puts ("---- test 1 ------");
   test = mbstowcs (tmp, str, (strlen (str) + 1) * sizeof (char));