From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49538 invoked by alias); 30 Oct 2017 12:49:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 49251 invoked by uid 89); 30 Oct 2017 12:49:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*F:U*john, H*Ad:D*cx, Hx-languages-length:702, HX-Greylist:AUTH X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Oct 2017 12:49:47 +0000 Received: from dhcp-10-248-127-128.eduroam.wireless.private.cam.ac.uk (global-5-144.nat-2.net.cam.ac.uk [131.111.5.144]) by mail.baldwin.cx (Postfix) with ESMTPSA id C2E5D10A8BE; Mon, 30 Oct 2017 08:49:44 -0400 (EDT) Subject: Re: Opinion about -Wtautological-compare To: Yao Qi , Simon Marchi References: Cc: GDB Patches From: John Baldwin Message-ID: <189cefb7-aa0c-16bd-d78c-cc6f1e5c1344@baldwin.cx> Date: Mon, 30 Oct 2017 12:49:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-10/txt/msg00887.txt.bz2 On 10/30/17 9:35 AM, Yao Qi wrote: > On Sat, Oct 28, 2017 at 4:24 AM, Simon Marchi wrote: > >> Personally, I think the warning is useful and can reveal bugs, so I'd like to keep >> it. I lean towards 2 or 3, because they help convey the idea that we check if the >> value is within a range. If you are following with the architecture manual on the >> side, it will probably show the same range (0-3) for those bits, so it helps if the >> code does the same. >> > > My vote is 3. PR 22188. I vote for 3 as well. I think it is useful to describe both bounds of a value explicitly even if one bound is at the "edge". -- John Baldwin