From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1386) id B3CCD3858C66; Tue, 22 Nov 2022 08:40:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3CCD3858C66 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] gas/sframe: 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: 31c1130f35e0ef800ea4d92224a72872ffe4a5db X-Git-Newrev: 3238a7507528dd0fec87e35bad50815b5ee5824c Message-Id: <20221122084001.B3CCD3858C66@sourceware.org> Date: Tue, 22 Nov 2022 08:40:01 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2022 08:40:01 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D3238a7507528= dd0fec87e35bad50815b5ee5824c commit 3238a7507528dd0fec87e35bad50815b5ee5824c Author: Jan Beulich Date: Tue Nov 22 09:39:44 2022 +0100 gas/sframe: avoid "shadowing" of glibc function name =20 Once again: Old enough glibc has an (unguarded) declaration of index() in string.h, which triggers a "shadows a global declaration" warning with our choice of wanring level and with at least some gcc versions. Diff: --- gas/gen-sframe.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gas/gen-sframe.c b/gas/gen-sframe.c index 13f5bda7f9e..896fbe44c6b 100644 --- a/gas/gen-sframe.c +++ b/gas/gen-sframe.c @@ -202,25 +202,25 @@ struct sframe_fre_offset_func_map static unsigned int sframe_fre_offset_func_map_index (unsigned int offset_size) { - unsigned int index =3D SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_MAX; + unsigned int idx =3D SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_MAX; =20 switch (offset_size) { case SFRAME_FRE_OFFSET_1B: - index =3D SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_1B; + idx =3D SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_1B; break; case SFRAME_FRE_OFFSET_2B: - index =3D SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_2B; + idx =3D SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_2B; break; case SFRAME_FRE_OFFSET_4B: - index =3D SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_4B; + idx =3D SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_4B; break; default: /* Not supported in SFrame. */ break; } =20 - return index; + return idx; } =20 /* Mapping from offset size to the output function to emit the value. */ @@ -445,7 +445,7 @@ output_sframe_row_entry (symbolS *fde_start_addr, expressionS exp; unsigned int fre_addr_size; =20 - unsigned int index =3D 0; + unsigned int idx =3D 0; unsigned int fre_write_offsets =3D 0; =20 fre_addr_size =3D 4; /* 4 bytes by default. FIXME tie it to fre_type? = */ @@ -475,23 +475,23 @@ output_sframe_row_entry (symbolS *fde_start_addr, fre_offset_size); out_one (fre_info); =20 - index =3D sframe_fre_offset_func_map_index (fre_offset_size); - gas_assert (index < SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_MAX); + idx =3D sframe_fre_offset_func_map_index (fre_offset_size); + gas_assert (idx < SFRAME_FRE_OFFSET_FUNC_MAP_INDEX_MAX); =20 /* Write out the offsets in order - cfa, bp, ra. */ - fre_offset_func_map[index].out_func (sframe_fre->cfa_offset); + fre_offset_func_map[idx].out_func (sframe_fre->cfa_offset); fre_write_offsets++; =20 #ifdef SFRAME_FRE_RA_TRACKING if (sframe_fre->ra_loc =3D=3D SFRAME_FRE_ELEM_LOC_STACK) { - fre_offset_func_map[index].out_func (sframe_fre->ra_offset); + fre_offset_func_map[idx].out_func (sframe_fre->ra_offset); fre_write_offsets++; } #endif if (sframe_fre->bp_loc =3D=3D SFRAME_FRE_ELEM_LOC_STACK) { - fre_offset_func_map[index].out_func (sframe_fre->bp_offset); + fre_offset_func_map[idx].out_func (sframe_fre->bp_offset); fre_write_offsets++; }