From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29654 invoked by alias); 15 Jan 2014 09:12:28 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 29644 invoked by uid 89); 15 Jan 2014 09:12:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Jan 2014 09:12:27 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0F9CLWT022883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 15 Jan 2014 04:12:22 -0500 Received: from redhat.com (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0F9CGZv023111 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 15 Jan 2014 04:12:19 -0500 Date: Wed, 15 Jan 2014 09:12:00 -0000 From: Marek Polacek To: Florian Weimer Cc: GCC Patches , Richard Biener , "Joseph S. Myers" , Jason Merrill Subject: Re: [C PATCH] Disallow subtracting pointers to empty structs (PR c/58346) Message-ID: <20140115091216.GI4458@redhat.com> References: <20140113163226.GD4458@redhat.com> <20140113164859.GE4458@redhat.com> <20140113204839.GF4458@redhat.com> <52D57940.4060004@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52D57940.4060004@redhat.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2014-01/txt/msg00846.txt.bz2 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