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
+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
2019-06-24 H.J. Lu <hongjiu.lu@intel.com>
PR ld/24721
-/* Return LTO kind string name that corresponds to INDEX enum value. */
+/* Return LTO kind string name that corresponds to IDX enum value. */
-get_lto_kind (unsigned int index)
+get_lto_kind (unsigned int idx)
{
static char buffer[64];
const char *lto_kind_str[5] =
{
static char buffer[64];
const char *lto_kind_str[5] =
- 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 LTO resolution string name that corresponds to INDEX enum value. */
+/* Return LTO resolution string name that corresponds to IDX enum value. */
-get_lto_resolution (unsigned int index)
+get_lto_resolution (unsigned int idx)
{
static char buffer[64];
static const char *lto_resolution_str[10] =
{
static char buffer[64];
static const char *lto_resolution_str[10] =
"PREVAILING_DEF_IRONLY_EXP",
};
"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 LTO visibility string name that corresponds to INDEX enum value. */
+/* Return LTO visibility string name that corresponds to IDX enum value. */
-get_lto_visibility (unsigned int index)
+get_lto_visibility (unsigned int idx)
{
static char buffer[64];
const char *lto_visibility_str[4] =
{
static char buffer[64];
const char *lto_visibility_str[4] =
- 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);