From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2485 invoked by alias); 30 Oct 2017 14:27:12 -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 2469 invoked by uid 89); 30 Oct 2017 14:27:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:D*cx, HTo:U*john X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Oct 2017 14:27:10 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v9UER3pr029005 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 30 Oct 2017 10:27:08 -0400 Received: by simark.ca (Postfix, from userid 112) id A615C1E533; Mon, 30 Oct 2017 10:27:03 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 122571E51C; Mon, 30 Oct 2017 10:26:43 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 30 Oct 2017 14:27:00 -0000 From: Simon Marchi To: John Baldwin Cc: Yao Qi , Simon Marchi , GDB Patches Subject: Re: Opinion about -Wtautological-compare In-Reply-To: <189cefb7-aa0c-16bd-d78c-cc6f1e5c1344@baldwin.cx> References: <189cefb7-aa0c-16bd-d78c-cc6f1e5c1344@baldwin.cx> Message-ID: <7c7f750a3ec44f36995099453159f6b7@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 30 Oct 2017 14:27:03 +0000 X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00892.txt.bz2 On 2017-10-30 08:49, John Baldwin wrote: > 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". Thanks to you both, I'll post a patch shortly. Simon