This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 35/358] Fix -Wsahdow warnings
- From: Andrey Smirnov <andrew dot smirnov at gmail dot com>
- To: Stan Shebs <stanshebs at earthlink dot net>
- Cc: gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 23 Nov 2011 10:46:15 +0600
- Subject: Re: [PATCH 35/358] Fix -Wsahdow warnings
- References: <87obw470hx.fsf@gmail.com> <4ECC3FD2.1000309@earthlink.net>
On Wed, Nov 23, 2011 at 7:35 AM, Stan Shebs <stanshebs@earthlink.net> wrote:
> On 11/22/11 5:25 AM, Andrey Smirnov wrote:
> [...]
>
> - ? ? ? ? struct symtab_and_line sal;
> + ? ? ? ? struct symtab_and_line las;
>
>
> While clever and amusing, this is probably a bad idea for the long run;
> without any comment explaining it, some future hacker is really really going
> to want to change it back to "sal", and when enough time has passed, no one
> will remember why they should object.
There are 358 patches and I assure you being clever and amusing did
not come to my mid while I was renaming all conflicting variables. As
to your objection: I thought the goal of the whole patchset is to add
-Wshadow to default compiler flags, is it not? I case it is, than the
future hacker will get a slap from compiler, for shadowing the previous
definition of `sal'. And in case it isn't I have a very loud "Why?!"
to shout at the universe.
> ?Better to use something dull and predictable like "sal2".
Given the choice between `las' and `sal2' I have no preference either
way, so I'll rename it.
Andrey Smirnov