summaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2019-06-25 12:02:23 +0200
committerJan Beulich <jbeulich@suse.com>2019-06-25 12:02:23 +0200
commit8e5cb9a54e156ba24a439aefa7b35e53b4cb0374 (patch)
tree82a1b310fa0a283f99bdd0726b19ce244449e4ea /ld/plugin.c
parentab9f654ca3f1222f63533aabfffc223ae1fc69dc (diff)
downloadbinutils-gdb-8e5cb9a54e156ba24a439aefa7b35e53b4cb0374.tar.gz
ld/plugins: avoid shadowing a C library symbol
With my (oldish) gcc/glibc combination I'm seeing .../ld/plugin.c: In function ‘get_lto_kind’: .../ld/plugin.c:664: error: declaration of ‘index’ shadows a global declaration /usr/include/string.h:487: error: shadowed declaration is here .../ld/plugin.c: In function ‘get_lto_resolution’: .../ld/plugin.c:685: error: declaration of ‘index’ shadows a global declaration /usr/include/string.h:487: error: shadowed declaration is here .../ld/plugin.c: In function ‘get_lto_visibility’: .../ld/plugin.c:711: error: declaration of ‘index’ shadows a global declaration /usr/include/string.h:487: error: shadowed declaration is here
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index fcd864a117c..0344da2df9e 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -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;
}