Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrey Smirnov <andrew.smirnov@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Joel Brobecker <brobecker@adacore.com>,
	gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH 18/348] Fix -Wsahdow warnings
Date: Wed, 30 Nov 2011 03:48:00 -0000	[thread overview]
Message-ID: <CAHQ1cqEBOw9hYZxUKXH+hZiusXM+09vbSsNTMz32QgvrdPd5hw@mail.gmail.com> (raw)
In-Reply-To: <m3borun3fi.fsf@fleche.redhat.com>

On Wed, Nov 30, 2011 at 2:17 AM, Tom Tromey <tromey@redhat.com> wrote:
> 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
>

I know I probably should go to GCC mailing list and ask that question
there, but anyways, would this patch cause gcc to stop generating the
warning about local variable shadowing global one from system headers?

The reason I'm asking is because there are several instances of said
shadowing in GDB, for example
https://github.com/ndreys/gdb/commit/bf87d6034f7093aa207a1b14233be48214a6c3d8
(please ignore the erroneous description, for some unknown reason I
call `optarg' `optparse')

I hope that kinds of shadowing would still be detectable even with this
patch applied.


> 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.
>

It would pretty much solve that problem, yes, but still it would
divide patch submitters into two groups those who have newest gcc and
-Wshadow enabled by default, and those who don't. And the people
without -Wshadow enabled compilers would be, on occasion, breaking the
build because they have no means to check for -Wshadow caused errors.
I hope I missing something and it is not the case, but that how the
things seems to me now.

Andrey Smirnov


  reply	other threads:[~2011-11-30  3:48 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                 ` [PATCH 18/348] Fix -Wsahdow warnings Tom Tromey
2011-11-30  3:48                   ` Andrey Smirnov [this message]
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=CAHQ1cqEBOw9hYZxUKXH+hZiusXM+09vbSsNTMz32QgvrdPd5hw@mail.gmail.com \
    --to=andrew.smirnov@gmail.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /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