From: "Manuel López-Ibáñez" <lopezibanez@gmail.com>
To: Mark Wielaard <mjw@redhat.com>, Martin Sebor <msebor@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Warn when comparing nonnull arguments to NULL in a function.
Date: Tue, 15 Sep 2015 12:22:00 -0000 [thread overview]
Message-ID: <55F80D42.20905@gmail.com> (raw)
In-Reply-To: <1442305942.8165.334.camel@bordewijk.wildebeest.org>
On 15/09/15 10:32, Mark Wielaard wrote:
> On Mon, 2015-09-14 at 21:37 -0600, Martin Sebor wrote:
> Although I now notice they differ on the placement of the carrot.
> Maybe the location passed into the warning is not correct/ideal?
The caret is placed at the location given by expand_location(loc), with loc
being the location passed to warning_at(). As far as I am aware, there are no
bugs on that. If the caret is wrong, it is definitely because the location
passed is the wrong one. You need to find the correct one (which may appear up
in the call stack and may need to be passed down) and pass that one instead.
You can test the location with { dg-warning "18:nonnull argument" } where 18 is
the column number expected. I wish it was used more frequently, in particular
in those cases where we have the perfect location and it would be pity to regress.
Cheers,
Manuel.
next prev parent reply other threads:[~2015-09-15 12:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 21:51 Mark Wielaard
2015-09-09 22:02 ` Jeff Law
2015-09-09 22:33 ` Jakub Jelinek
2015-09-09 23:01 ` Mark Wielaard
2015-09-14 19:26 ` Jeff Law
2015-09-15 3:43 ` Martin Sebor
2015-09-15 8:48 ` Mark Wielaard
2015-09-15 12:22 ` Manuel López-Ibáñez [this message]
2015-09-15 16:27 ` Mark Wielaard
2015-09-15 14:56 ` Martin Sebor
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=55F80D42.20905@gmail.com \
--to=lopezibanez@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=mjw@redhat.com \
--cc=msebor@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).