This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 033/238] [misc.] breakpoint.c: -Wshadow fix
- From: Andrey Smirnov <andrew dot smirnov at gmail dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Pedro Alves <pedro at codesourcery dot com>, Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches at sourceware dot org, tromey at redhat dot com
- Date: Mon, 5 Dec 2011 18:59:08 +0600
- Subject: Re: [PATCH 033/238] [misc.] breakpoint.c: -Wshadow fix
- References: <m3obw42cr8.fsf@fleche.redhat.com> <1322493153-29512-1-git-send-email-andrew.smirnov@gmail.com> <20111205112523.GJ2777@adacore.com>
> I looked at it, and it looks fine from a functional point of view.
> However, I'd rather have Jan or Pedro, who have modified this function
> more often than I have, to weigh in.
>
> Personally, I'm not keen on the fact that a global variable is reused
> in the context of a local loop. So I would rather rename the local
> variable inside the loop rather than delete the local variable,
> and reuse the global one. ?It makes for a bigger patch, but I think
> it's better in the end.
I tried to used the strategy you describe in all my patches and initial
patch actually renamed the local variable, this modification was made
because of Tom's recommendation, see
http://sourceware.org/ml/gdb-patches/2011-11/msg00601.html
So, I guess we will have to get to some sort of consensus on how to deal
with that name clash.
Andrey Smirnov