From: "Manuel López-Ibáñez" <lopezibanez@gmail.com>
To: Marek Polacek <polacek@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [C/C++ PATCH] Improve -Wlogical-op (PR c/63357)
Date: Tue, 21 Apr 2015 14:19:00 -0000 [thread overview]
Message-ID: <55365C6E.1080100@gmail.com> (raw)
In-Reply-To: <20150421111638.GB28950@redhat.com>
On 21/04/15 13:16, Marek Polacek wrote:
> (-Wlogical-op still isn't enabled neither by -Wall nor by -Wextra.)
The reason is https://gcc.gnu.org/PR61534
which means we don't want to warn for:
extern int xxx;
#define XXX xxx
int test (void)
{
if (!XXX && xxx)
return 4;
else
return 0;
}
(gcc/testsuite/gcc.dg/pr40172-3.c, although it should be moved to c-c++-common)
As noted in the PR: The problem is that !XXX becomes XXX == 0, but it has the
location of "!", which is not virtual. If we look at the argument of the
expression, then XXX is actually a var_decl, whose location corresponds to the
declaration and not the use, and it is not virtual either. This is PR43486.
> Bootstrapped/regtested on x86_64-linux, ok for trunk?
Does it pass bootstrap if you enable it? That is, is GCC itself -Wlogical-op clean?
Cheers,
Manuel.
next prev parent reply other threads:[~2015-04-21 14:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-21 11:16 Marek Polacek
2015-04-21 14:19 ` Manuel López-Ibáñez [this message]
2015-04-22 8:59 ` Marek Polacek
2015-04-22 9:51 ` Manuel López-Ibáñez
2015-04-22 9:54 ` Manuel López-Ibáñez
2015-04-22 11:12 ` Marek Polacek
2015-04-23 22:02 ` Jeff Law
2015-04-25 20:19 Gerald Pfeifer
2015-04-27 14:47 ` Marek Polacek
2015-04-27 14:50 ` Marek Polacek
2015-04-27 16:06 ` Jeff Law
2015-04-27 16:10 ` Marek Polacek
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=55365C6E.1080100@gmail.com \
--to=lopezibanez@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--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).