about summary refs log tree commit diff
path: root/elf
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 /elf
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 'elf')
-rw-r--r--elf/dl-load.c2
-rw-r--r--elf/dl-printf.c2
-rw-r--r--elf/dl-tunables.c2
-rw-r--r--elf/rtld.c6
-rw-r--r--elf/sprof.c12
-rw-r--r--elf/tst-dlmodcount.c2
-rw-r--r--elf/tst-tls-dlinfo.c2
7 files changed, 14 insertions, 14 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 1ad0868dad..911db4c906 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -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,
diff --git a/elf/dl-printf.c b/elf/dl-printf.c
index d3264ba96c..429d2e80c2 100644
--- a/elf/dl-printf.c
+++ b/elf/dl-printf.c
@@ -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;
diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
index 8e7ee9df10..a3e399fda2 100644
--- a/elf/dl-tunables.c
+++ b/elf/dl-tunables.c
@@ -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);
diff --git a/elf/rtld.c b/elf/rtld.c
index 3e771a93d8..3b78f40562 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -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,
diff --git a/elf/sprof.c b/elf/sprof.c
index 405fbcbf38..da7d817b09 100644
--- a/elf/sprof.c
+++ b/elf/sprof.c
@@ -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);
diff --git a/elf/tst-dlmodcount.c b/elf/tst-dlmodcount.c
index 8a96803d85..d5f89b8f79 100644
--- a/elf/tst-dlmodcount.c
+++ b/elf/tst-dlmodcount.c
@@ -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)))
     {
diff --git a/elf/tst-tls-dlinfo.c b/elf/tst-tls-dlinfo.c
index 7d2b42e2ab..6d032bdc53 100644
--- a/elf/tst-tls-dlinfo.c
+++ b/elf/tst-tls-dlinfo.c
@@ -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))