public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marek Polacek <polacek@redhat.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Biener <rguenther@suse.de>,
	       "Joseph S. Myers" <joseph@codesourcery.com>,
	       Jason Merrill <jason@redhat.com>
Subject: Re: [C PATCH] Disallow subtracting pointers to empty structs (PR c/58346)
Date: Wed, 15 Jan 2014 09:12:00 -0000	[thread overview]
Message-ID: <20140115091216.GI4458@redhat.com> (raw)
In-Reply-To: <52D57940.4060004@redhat.com>

On Tue, Jan 14, 2014 at 06:52:00PM +0100, Florian Weimer wrote:
> On 01/13/2014 09:48 PM, Marek Polacek wrote:
> >+bool
> >+pointer_to_zero_sized_aggr_p (tree t)
> >+{
> >+  t = strip_pointer_operator (t);
> >+  if (RECORD_OR_UNION_TYPE_P (t)
> >+      && TYPE_SIZE (t)
> >+      && integer_zerop (TYPE_SIZE (t)))
> >+    return true;
> >+  return false;
> >+}
> 
> I think you can just return the value of the condition, there's no
> need for the if statement.

Oops, yeah, forgot to change that.  Will do it in next patch.

	Marek

  reply	other threads:[~2014-01-15  9:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 16:32 Marek Polacek
2014-01-13 17:21 ` Florian Weimer
2014-01-13 17:22 ` Marek Polacek
2014-01-13 20:48   ` Marek Polacek
2014-01-14 14:39     ` Jason Merrill
2014-01-14 17:52     ` Florian Weimer
2014-01-15  9:12       ` Marek Polacek [this message]
2014-01-14 21:42     ` Joseph S. Myers
2014-01-15 10:27       ` Marek Polacek
2014-01-15 10:35         ` Jakub Jelinek
2014-01-15 13:50           ` Marek Polacek
2014-01-15 21:23             ` Joseph S. Myers
2014-01-16 18:52               ` Marek Polacek
2014-01-23  9:15                 ` Marek Polacek
2014-01-23 17:47                   ` Joseph S. Myers
2014-01-16 11:50             ` Eric Botcazou
2014-01-16 11:58               ` 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=20140115091216.GI4458@redhat.com \
    --to=polacek@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=rguenther@suse.de \
    /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).