From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1386) id A037B38618E0; Fri, 1 Dec 2023 09:13:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A037B38618E0 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jan Beulich To: bfd-cvs@sourceware.org Subject: [binutils-gdb] binutils/Dwarf: avoid "shadowing" of glibc function name X-Act-Checkin: binutils-gdb X-Git-Author: Jan Beulich X-Git-Refname: refs/heads/master X-Git-Oldrev: 2d9b910d5612d802b3c68f04ec69b08e356c503e X-Git-Newrev: 236b484749017b63c80dcedb07f08dfd6ea9e9a1 Message-Id: <20231201091359.A037B38618E0@sourceware.org> Date: Fri, 1 Dec 2023 09:13:59 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Dec 2023 09:13:59 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D236b48474901= 7b63c80dcedb07f08dfd6ea9e9a1 commit 236b484749017b63c80dcedb07f08dfd6ea9e9a1 Author: Jan Beulich Date: Fri Dec 1 10:13:17 2023 +0100 binutils/Dwarf: avoid "shadowing" of glibc function name =20 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. Diff: --- binutils/dwarf.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 705451db68f..9e7d8753148 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -6833,7 +6833,7 @@ display_loclists_list (struct dwarf_section * sectio= n, unsigned int pointer_size; unsigned int offset_size; unsigned int dwarf_version; - uint64_t index; + uint64_t idx; =20 /* Initialize it due to a false compiler warning. */ uint64_t begin =3D -1, vbegin =3D -1; @@ -6892,28 +6892,28 @@ display_loclists_list (struct dwarf_section * sect= ion, break; =20 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 =3D 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; =20 case DW_LLE_startx_endx: - READ_ULEB (index, start, section_end); + READ_ULEB (idx, start, section_end); begin =3D 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 =3D fetch_indexed_addr - (debug_info_p->addr_base + index * pointer_size, pointer_size); + (debug_info_p->addr_base + idx * pointer_size, pointer_size); break; =20 case DW_LLE_startx_length: - READ_ULEB (index, start, section_end); + READ_ULEB (idx, start, section_end); begin =3D 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 +=3D begin; break;