From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93437 invoked by alias); 30 Sep 2016 19:08:25 -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 93420 invoked by uid 89); 30 Sep 2016 19:08:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=msgid, friend X-HELO: mail-qk0-f181.google.com Received: from mail-qk0-f181.google.com (HELO mail-qk0-f181.google.com) (209.85.220.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Sep 2016 19:08:23 +0000 Received: by mail-qk0-f181.google.com with SMTP id n189so42638267qke.0 for ; Fri, 30 Sep 2016 12:08:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=fNy20vI06aadxucJ/5M0LZx2w0tcx16kiqchwsH2YRQ=; b=fMgg3EDPwppf/R8feFuH0/WTKXFHnu7RkpBd50Qv0NX6QAcVqP5FZLmp+hTlAyHw6v umh1kFpsaE3s0rUsrwXhv7m8mB+m6/3KHMWYVi017Ifr7OU1pqo+Rtz3vSaEGFmahnAd aFeqi/3b3gBtWdJYf5RR2Y56Me9mMeoyBrkFzOlVEp1hfQpwRz9dTQk3LUwgU39g/Ljw mQK4yA0A0aO8VhYLKKT9UggcjUtFhEBjSOq321wjQKgcTT3amU7mNdkj3HbcANIvpcMT V19zP7ge0TK03hJccPLUySnmpCO4pscRCjpm3RUG9HBTF3JpzPHuylrNGDtX+ebQwGNh loMA== X-Gm-Message-State: AA6/9RlZMY1kurqizCruhGLFmv0BVaHWiYsPU9E4xg+g9+euqdEymzGMhCiIAqcZSZdp/g== X-Received: by 10.55.183.1 with SMTP id h1mr8396673qkf.264.1475262501707; Fri, 30 Sep 2016 12:08:21 -0700 (PDT) Received: from [192.168.0.26] (75-166-199-51.hlrn.qwest.net. [75.166.199.51]) by smtp.gmail.com with ESMTPSA id a94sm10945250qkh.11.2016.09.30.12.08.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Sep 2016 12:08:21 -0700 (PDT) Subject: Re: C/C++ PATCH to implement -Wpointer-compare warning (PR c++/64767) To: Marek Polacek , Jason Merrill References: <20160910145843.GJ19950@redhat.com> <20160915121631.GY19950@redhat.com> <20160923131537.GB3223@redhat.com> <20160930164337.GE3223@redhat.com> <15342189-351a-5655-42b3-9ad32667ec90@gmail.com> Cc: GCC Patches From: Martin Sebor Message-ID: <31bff7de-0d43-765d-55e9-e1535713e1e7@gmail.com> Date: Fri, 30 Sep 2016 19:52:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <15342189-351a-5655-42b3-9ad32667ec90@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg02424.txt.bz2 On 09/30/2016 11:05 AM, Martin Sebor wrote: >> + permerror (input_location, "ISO C++11 only allows pointer " >> + "conversions for integer literals"); > > FWIW, I think it would be clearer to either mention the currently > selected language version or leave it out completely rather than > hardcoding C++11. When the user specifies -std=c++14 (or later), > or when that's the current version used by the compiler, a warning > that tells them what C++ 11 allows isn't really relevant (or > meaningful), and becomes less so as time goes on. Btw., I realize there are other instances where the C++ version has been hardcoded and so I should have made it clear that I meant my comment as a general suggestion, not as an objection to the patch. Sorry if that wasn't apparent. I've quickly surveyed some of the existing messages that mention a C++ version and found instances where it applies only to the referenced version of the standard and prior but not later versions. For example: msgid "in C++98 %q+D may not be static because it is a member of a union" msgid "in C++03 a class-key must be used when declaring a friend" But I also came across another form that may resolve the concern I raised: mentioning the version along with whether it's the first or last that supports (or doesn't support) the construct, such as "C++11 and above." Here's one example of it: msgid "in C++11 and above a default constructor can be explicit" It might be worth to come up with a convention to adopt in new messages and (gradually) change what's already there to use it. Martin