From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91146 invoked by alias); 23 Sep 2016 14:31:57 -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 91114 invoked by uid 89); 23 Sep 2016 14:31:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=H*F:U*jason, Hx-languages-length:835 X-HELO: mail-oi0-f53.google.com Received: from mail-oi0-f53.google.com (HELO mail-oi0-f53.google.com) (209.85.218.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Sep 2016 14:31:55 +0000 Received: by mail-oi0-f53.google.com with SMTP id w11so136253640oia.2 for ; Fri, 23 Sep 2016 07:31:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=3aKzrX76p/oW+ZKu8mBoBnpRnl6KlyqQpmNUtpSS9eA=; b=H+DUXmAH4ydYJ+ApKR+MUOjjki2pajE1rBbSos4nyirc0AY2PPj19qdrsmnWF3chFp APu9JxYEOqKPiKi4rN1UrhbDNwmbIhRa+R4ALN/HCiHlq59cDjK3QCqnhvnm+EZxOrC+ d/eEYpUo4Pvc1dmgCqpbRunWFuSR3YdiXodnhN2sUGNnLzZF9WUBaGoKb/LMbMjIDjyH lyxOAex0KI4boKCnsjCCLwpiyRYZwXwjaSyG9F+nLajtNc22mVRrbCVdM4BcYM0I9Ox7 9ULsUpFQKDJwuKSyXL+4wbrCkloWTsUhIWEd+WSHR5HT6VXV3pw5QYSt+GfXw9oSposL 90CQ== X-Gm-Message-State: AE9vXwPpiKp6YgLW25G5pSGWF8rIiPQStJH6LMIMsQe/gua32CB2/1hxbM8KEr4v/4S4oDimCRVkzPYl/EzepZMs X-Received: by 10.202.95.130 with SMTP id t124mr11056006oib.159.1474641114378; Fri, 23 Sep 2016 07:31:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.105.167 with HTTP; Fri, 23 Sep 2016 07:31:33 -0700 (PDT) In-Reply-To: <20160923131537.GB3223@redhat.com> References: <20160910145843.GJ19950@redhat.com> <20160915121631.GY19950@redhat.com> <20160923131537.GB3223@redhat.com> From: Jason Merrill Date: Fri, 23 Sep 2016 14:37:00 -0000 Message-ID: Subject: Re: C/C++ PATCH to implement -Wpointer-compare warning (PR c++/64767) To: Marek Polacek Cc: GCC Patches , Joseph Myers Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg01696.txt.bz2 On Fri, Sep 23, 2016 at 9:15 AM, Marek Polacek wrote: > On Wed, Sep 21, 2016 at 03:52:09PM -0400, Jason Merrill wrote: >> On Mon, Sep 19, 2016 at 2:49 PM, Jason Merrill wrote: >> > I suppose that an INTEGER_CST of character type is necessarily a >> > character constant, so adding a check for !char_type_p ought to do the >> > trick. >> >> Indeed it does. I'm checking this in: > > Nice, thanks. What about the original patch? We still need to warn > (or error for C++11) for pointer comparisons. If we still accept pointer comparisons in C++, that's another bug with treating \0 as a null pointer constant. This seems to be because ocp_convert of \0 to int produces an INTEGER_CST indistinguishable from literal 0. Jason