ld/plugins: avoid shadowing a C library symbol
authorJan Beulich <jbeulich@novell.com>
Tue, 25 Jun 2019 10:02:23 +0000 (12:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 25 Jun 2019 10:02:23 +0000 (12:02 +0200)
With my (oldish) gcc/glibc combination I'm seeing

.../ld/plugin.c: In function \91get_lto_kind\92:
.../ld/plugin.c:664: error: declaration of \91index\92 shadows a global declaration
/usr/include/string.h:487: error: shadowed declaration is here
.../ld/plugin.c: In function \91get_lto_resolution\92:
.../ld/plugin.c:685: error: declaration of \91index\92 shadows a global declaration
/usr/include/string.h:487: error: shadowed declaration is here
.../ld/plugin.c: In function \91get_lto_visibility\92:
.../ld/plugin.c:711: error: declaration of \91index\92 shadows a global declaration
/usr/include/string.h:487: error: shadowed declaration is here

ld/ChangeLog
ld/plugin.c

index 2c11a66c5c5af52cf65254ae53674d0f752ca49d..cb9ae84c63cbb700d42904190ebc74ea28efd12a 100644 (file)
@@ -1,3 +1,8 @@
+2019-06-25  Jan Beulich  <jbeulich@suse.com>
+
+       * plugin.c (get_lto_kind, get_lto_resolution,
+       get_lto_visibility): Rename "index" to "idx".
+
 2019-06-24  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR ld/24721
index fcd864a117ca576efbf6b8562f9266c620391579..0344da2df9e10a968f847439a0a10679e369a006 100644 (file)
@@ -659,9 +659,9 @@ is_visible_from_outside (struct ld_plugin_symbol *lsym,
   return FALSE;
 }
 
-/* Return LTO kind string name that corresponds to INDEX enum value.  */
+/* Return LTO kind string name that corresponds to IDX enum value.  */
 static const char *
-get_lto_kind (unsigned int index)
+get_lto_kind (unsigned int idx)
 {
   static char buffer[64];
   const char *lto_kind_str[5] =
@@ -673,16 +673,16 @@ get_lto_kind (unsigned int index)
     "COMMON"
   };
 
-  if (index < ARRAY_SIZE (lto_kind_str))
-    return lto_kind_str [index];
+  if (idx < ARRAY_SIZE (lto_kind_str))
+    return lto_kind_str [idx];
 
-  sprintf (buffer, _("unknown LTO kind value %x"), index);
+  sprintf (buffer, _("unknown LTO kind value %x"), idx);
   return buffer;
 }
 
-/* Return LTO resolution string name that corresponds to INDEX enum value.  */
+/* Return LTO resolution string name that corresponds to IDX enum value.  */
 static const char *
-get_lto_resolution (unsigned int index)
+get_lto_resolution (unsigned int idx)
 {
   static char buffer[64];
   static const char *lto_resolution_str[10] =
@@ -699,16 +699,16 @@ get_lto_resolution (unsigned int index)
     "PREVAILING_DEF_IRONLY_EXP",
   };
 
-  if (index < ARRAY_SIZE (lto_resolution_str))
-    return lto_resolution_str [index];
+  if (idx < ARRAY_SIZE (lto_resolution_str))
+    return lto_resolution_str [idx];
 
-  sprintf (buffer, _("unknown LTO resolution value %x"), index);
+  sprintf (buffer, _("unknown LTO resolution value %x"), idx);
   return buffer;
 }
 
-/* Return LTO visibility string name that corresponds to INDEX enum value.  */
+/* Return LTO visibility string name that corresponds to IDX enum value.  */
 static const char *
-get_lto_visibility (unsigned int index)
+get_lto_visibility (unsigned int idx)
 {
   static char buffer[64];
   const char *lto_visibility_str[4] =
@@ -719,10 +719,10 @@ get_lto_visibility (unsigned int index)
     "HIDDEN"
   };
 
-  if (index < ARRAY_SIZE (lto_visibility_str))
-    return lto_visibility_str [index];
+  if (idx < ARRAY_SIZE (lto_visibility_str))
+    return lto_visibility_str [idx];
 
-  sprintf (buffer, _("unknown LTO visibility value %x"), index);
+  sprintf (buffer, _("unknown LTO visibility value %x"), idx);
   return buffer;
 }
 
This page took 0.028633 seconds and 4 git commands to generate.