From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: Andrey Smirnov <andrew.smirnov@gmail.com>,
gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 18/348] Fix -Wsahdow warnings
Date: Tue, 29 Nov 2011 19:18:00 -0000 [thread overview]
Message-ID: <m3borun3fi.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20111125142615.GV13809@adacore.com> (Joel Brobecker's message of "Fri, 25 Nov 2011 06:26:15 -0800")
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> As to the final decision of enabling -Wshadow by default, I agree
Joel> a little more to the idea, although not quite convinced yet. So far,
Joel> Eli is pro. Mark is against. I'm 50/50. Unless we get more feedback
Joel> from other GMs, you've done the work, we could at least try it and
Joel> see where that gets us.
I'm generally in favor of it.
I think it is unfortunate that it causes us to rename variables when
they clash in a way that is unimportant in practice. This is the
function-version-scalar issue that Mark points out.
However, I have also run across code in gdb where there is local
shadowing which has confused me (no example at hand though, sorry). I
would like to see these cleaned up.
On balance I don't really care that we have to rename some variables in
order to get rid of the bad code. There are plenty of names that are
equally clear as the ones already in the code.
Could we possibly mandate that -Wshadow only be used with a GCC that has
Alan Modra's patch in it?
Joel pinged it, and it went in, though I didn't see the actual patch:
http://gcc.gnu.org/ml/gcc-patches/2011-11/msg02340.html
Still, what it does is prevent the warning when shadowing something from
a system header. This seems decent to me and in particular will, I
think, largely address Mark's concerns.
All we'd need then is a bit of configury.
Tom
next prev parent reply other threads:[~2011-11-29 19:18 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-22 13:01 Andrey Smirnov
2011-11-22 18:03 ` Tom Tromey
2011-11-23 16:36 ` Mark Kettenis
2011-11-23 16:41 ` Ulrich Weigand
2011-11-23 18:21 ` Pedro Alves
2011-11-23 18:42 ` Joel Brobecker
2011-11-23 20:24 ` Mark Kettenis
2011-11-24 4:16 ` Andrey Smirnov
2011-11-24 11:36 ` Eli Zaretskii
2011-11-24 22:01 ` Joel Brobecker
2011-11-25 0:48 ` Andrey Smirnov
2011-11-25 14:26 ` Joel Brobecker
2011-11-25 15:52 ` About adding -Wshadow option by default (was Re: [PATCH 18/348] Fix -Wsahdow warnings) Pierre Muller
2011-11-25 16:36 ` Mark Kettenis
2011-11-29 19:18 ` Tom Tromey [this message]
2011-11-30 3:48 ` [PATCH 18/348] Fix -Wsahdow warnings Andrey Smirnov
2011-11-30 14:59 ` Tom Tromey
2011-12-01 4:15 ` Andrey Smirnov
2011-12-02 17:08 ` Tom Tromey
2011-11-25 12:03 ` Eli Zaretskii
2011-11-25 15:11 ` Mark Kettenis
2011-11-25 15:41 ` Eli Zaretskii
2011-11-25 16:26 ` Mark Kettenis
2011-11-25 18:20 ` Eli Zaretskii
2011-11-27 13:53 ` Mark Kettenis
2011-11-27 14:55 ` Pedro Alves
2011-11-27 16:35 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3borun3fi.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=andrew.smirnov@gmail.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox