From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25681 invoked by alias); 13 Dec 2011 07:18:02 -0000 Received: (qmail 25660 invoked by uid 22791); 13 Dec 2011 07:18:00 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Dec 2011 07:17:45 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id pBD7HeOm030280; Tue, 13 Dec 2011 08:17:40 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id pBD7Hcdp009062; Tue, 13 Dec 2011 08:17:38 +0100 (CET) Date: Tue, 13 Dec 2011 08:17:00 -0000 Message-Id: <201112130717.pBD7Hcdp009062@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: andrew.smirnov@gmail.com CC: gdb-patches@sourceware.org, andrew.smirnov@gmail.com In-reply-to: <1323747545-29987-2-git-send-email-andrew.smirnov@gmail.com> (message from Andrey Smirnov on Mon, 12 Dec 2011 19:38:39 -0800) Subject: Re: [PATCH 036/238] [index] i386-tdep.c: -Wshadow fix References: <1323747545-29987-1-git-send-email-andrew.smirnov@gmail.com> <1323747545-29987-2-git-send-email-andrew.smirnov@gmail.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00390.txt.bz2 > From: Andrey Smirnov > Date: Mon, 12 Dec 2011 19:38:39 -0800 > > To ChangeLog: > * i386-tdep.c (i386_record_lea_modrm_addr): Rename `index' to > `idx'(-Wshadow). > --- > gdb/i386-tdep.c | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) My position on this is unchanged. I think 'index' is a perfectly good variable name, and I consider it a misfeature of -Wshadow that it complains about this, which is fixed in recent GCC's. Please drop the changes in this class from your set. > diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c > index a4e3a22..e28a257 100644 > --- a/gdb/i386-tdep.c > +++ b/gdb/i386-tdep.c > @@ -3621,7 +3621,7 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr) > int havesib = 0; > uint8_t scale = 0; > uint8_t byte; > - uint8_t index = 0; > + uint8_t idx = 0; > uint8_t base = irp->rm; > > if (base == 4) > @@ -3637,7 +3637,7 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr) > } > irp->addr++; > scale = (byte >> 6) & 3; > - index = ((byte >> 3) & 7) | irp->rex_x; > + idx = ((byte >> 3) & 7) | irp->rex_x; > base = (byte & 7); > } > base |= irp->rex_b; > @@ -3703,9 +3703,9 @@ i386_record_lea_modrm_addr (struct i386_record_s *irp, uint64_t *addr) > else > *addr = (uint32_t) (offset64 + *addr); > > - if (havesib && (index != 4 || scale != 0)) > + if (havesib && (idx != 4 || scale != 0)) > { > - regcache_raw_read_unsigned (irp->regcache, irp->regmap[index], > + regcache_raw_read_unsigned (irp->regcache, irp->regmap[idx], > &offset64); > if (irp->aflag == 2) > *addr += offset64 << scale; > -- > 1.7.5.4 > >