public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Sebor <msebor@gmail.com>
To: Jason Merrill <jason@redhat.com>,
	Patrick Palka <patrick@parcs.ath.cx>, Jeff Law <law@redhat.com>
Cc: Marek Polacek <polacek@redhat.com>,
	Jakub Jelinek <jakub@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: C++ PATCH to fix missing warning (PR c++/70194)
Date: Fri, 18 Mar 2016 00:33:00 -0000	[thread overview]
Message-ID: <56EB4975.4080806@gmail.com> (raw)
In-Reply-To: <56EAFED5.8090305@redhat.com>

>> While I would find the warning less misleading if it simply said
>> in all three cases: "the address of 'x' will always evaluate as
>> ‘true’" I think it would be even more accurate if it said
>> "the address of 'x' may be assumed to evaluate to ‘true’"  That
>> avoids making claims about whether or not it actually is null,
>> doesn't talk about the NULL macro when one isn't used in the
>> code, and by saying "may assume" it allows for both making
>> the assumption as well as not making one.
>
> That sounds good except that talking about 'true' is wrong when there is
> an explicit comparison to a null pointer constant.  I'd be fine with
> changing "NULL" to "null" or similar.

Sounds good.  I will use bug 47931 - missing -Waddress warning
for comparison with NULL, to take care of the outstanding cases
where a warning still isn't issued (in either C++ or C) and also
adjust the text of the warning.

Martin

PS It seems that just adding STRIP_NOPS (op) to Marek's patch
significantly increases the number of successfully diagnosed
cases.  (The small patch I attached to 47931 covers nearly all
the remaining cases I could think of.)

  reply	other threads:[~2016-03-18  0:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 10:41 Marek Polacek
2016-03-15 10:56 ` Jakub Jelinek
2016-03-15 12:09   ` Marek Polacek
2016-03-15 19:41     ` Jason Merrill
2016-03-16 14:46       ` Marek Polacek
2016-03-16 19:44         ` Jason Merrill
2016-03-17  0:43         ` Martin Sebor
2016-03-17 16:33           ` Jeff Law
2016-03-17 16:49             ` Patrick Palka
2016-03-17 18:58               ` Martin Sebor
2016-03-17 19:17                 ` Jason Merrill
2016-03-18  0:33                   ` Martin Sebor [this message]
2016-03-17 16:45           ` Marek Polacek
2016-03-17 16:47           ` Jason Merrill
2016-03-17 16:49             ` Jeff Law

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=56EB4975.4080806@gmail.com \
    --to=msebor@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    --cc=law@redhat.com \
    --cc=patrick@parcs.ath.cx \
    --cc=polacek@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).