readelf: avoid shadowing a libiberty symbol

Message ID 5D10C634020000780023A9EC@prv1-mh.provo.novell.com
State New
Headers show
Series
  • readelf: avoid shadowing a libiberty symbol
Related show

Commit Message

Jan Beulich June 24, 2019, 12:46 p.m.
With my (oldish) gcc I'm seeing

.../binutils/readelf.c: In function ‘dump_ctf_indent_lines’:
.../binutils/readelf.c:13851: error: declaration of ‘spaces’ shadows a global declaration
.../binutils/../include/libiberty.h:253: error: shadowed declaration is here

binutils/
2019-06-24  Jan Beulich  <jbeulich@suse.com>

	* readelf.c (dump_ctf_indent_lines): Rename local variable
	"spaces" to "spcs".

Patch

--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -13848,10 +13848,10 @@  shdr_to_ctf_sect (ctf_sect_t *buf, Elf_I
 static char *dump_ctf_indent_lines (ctf_sect_names_t sect ATTRIBUTE_UNUSED,
 				    char *s, void *arg)
 {
-  char *spaces = arg;
+  char *spcs = arg;
   char *new_s;
 
-  if (asprintf (&new_s, "%s%s", spaces, s) < 0)
+  if (asprintf (&new_s, "%s%s", spcs, s) < 0)
     return s;
   return new_s;
 }