public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/48062] `shadowed declaration is here' should be a note
Date: Thu, 09 Jun 2011 07:55:00 -0000	[thread overview]
Message-ID: <bug-48062-4-cysNwEbIJY@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-48062-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48062

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-06-09 07:55:37 UTC ---
(In reply to comment #2)
> Produces no warning. So for me it is a bit confusing, since the warning setting
> refers to pieces of code and not to variables.

You are right and it is a bug. The reason is that each warning message (the
second should be note) is produced by different calls to warning(). These calls
are conditional on Wshadow but the #pragmas only disable Wshadow for a certain
location. The fix is to make "shadowed declaration is here" a call to inform()
(that is, a note) conditional on the first warning being emitted, which one can
test by checking the return value of warning(). Patches welcome.


  parent reply	other threads:[~2011-06-09  7:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-10 16:42 [Bug c/48062] New: " d.g.gorbachev at gmail dot com
2011-03-10 18:44 ` [Bug c/48062] " manu at gcc dot gnu.org
2011-06-09  1:46 ` momchil at xaxo dot eu
2011-06-09  7:55 ` manu at gcc dot gnu.org [this message]
2012-02-13 17:25 ` manu at gcc dot gnu.org
2014-06-03 16:57 ` mpolacek at gcc dot gnu.org
2014-06-05  5:31 ` mpolacek at gcc dot gnu.org
2014-06-05  6:21 ` mpolacek at gcc dot gnu.org

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=bug-48062-4-cysNwEbIJY@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).