aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-12-01 10:13:17 +0100
committerJan Beulich <jbeulich@suse.com>2023-12-01 10:13:17 +0100
commit236b484749017b63c80dcedb07f08dfd6ea9e9a1 (patch)
tree6bf71ea8090d3982c1844ab5e0a3ce339a95847c
parent2d9b910d5612d802b3c68f04ec69b08e356c503e (diff)
downloadbinutils-236b484749017b63c80dcedb07f08dfd6ea9e9a1.zip
binutils-236b484749017b63c80dcedb07f08dfd6ea9e9a1.tar.gz
binutils-236b484749017b63c80dcedb07f08dfd6ea9e9a1.tar.bz2
binutils/Dwarf: avoid "shadowing" of glibc function name
Yet once again: Old enough glibc has an (unguarded) declaration of index() in string.h, which triggers a "shadows a global declaration" warning with at least some gcc versions.
-rw-r--r--binutils/dwarf.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 705451d..9e7d875 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -6833,7 +6833,7 @@ display_loclists_list (struct dwarf_section * section,
unsigned int pointer_size;
unsigned int offset_size;
unsigned int dwarf_version;
- uint64_t index;
+ uint64_t idx;
/* Initialize it due to a false compiler warning. */
uint64_t begin = -1, vbegin = -1;
@@ -6892,28 +6892,28 @@ display_loclists_list (struct dwarf_section * section,
break;
case DW_LLE_base_addressx:
- READ_ULEB (index, start, section_end);
- print_hex (index, pointer_size);
+ READ_ULEB (idx, start, section_end);
+ print_hex (idx, pointer_size);
printf (_("(index into .debug_addr) "));
base_address = fetch_indexed_addr
- (debug_info_p->addr_base + index * pointer_size, pointer_size);
+ (debug_info_p->addr_base + idx * pointer_size, pointer_size);
print_hex (base_address, pointer_size);
printf (_("(base address)\n"));
break;
case DW_LLE_startx_endx:
- READ_ULEB (index, start, section_end);
+ READ_ULEB (idx, start, section_end);
begin = fetch_indexed_addr
- (debug_info_p->addr_base + index * pointer_size, pointer_size);
- READ_ULEB (index, start, section_end);
+ (debug_info_p->addr_base + idx * pointer_size, pointer_size);
+ READ_ULEB (idx, start, section_end);
end = fetch_indexed_addr
- (debug_info_p->addr_base + index * pointer_size, pointer_size);
+ (debug_info_p->addr_base + idx * pointer_size, pointer_size);
break;
case DW_LLE_startx_length:
- READ_ULEB (index, start, section_end);
+ READ_ULEB (idx, start, section_end);
begin = fetch_indexed_addr
- (debug_info_p->addr_base + index * pointer_size, pointer_size);
+ (debug_info_p->addr_base + idx * pointer_size, pointer_size);
READ_ULEB (end, start, section_end);
end += begin;
break;