From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109672 invoked by alias); 19 Oct 2016 20:13:18 -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 109549 invoked by uid 89); 19 Oct 2016 20:13:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=UD:Wint-in-bool-context-2.c, Hx-languages-length:1232 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, 19 Oct 2016 20:13:07 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 148D2624AA; Wed, 19 Oct 2016 20:13:06 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-87.phx2.redhat.com [10.3.116.87]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9JKD4jb023258; Wed, 19 Oct 2016 16:13:04 -0400 Subject: Re: [PATCH] Make -Wint-in-bool-context warn on suspicious shift ops To: Bernd Edlinger , Joseph Myers References: <87fuol77ri.fsf@mid.deneb.enyo.de> <20161017152304.GA303@x4> <20161017171124.GB303@x4> Cc: Markus Trippelsdorf , Jason Merrill , Florian Weimer , "gcc-patches@gcc.gnu.org" From: Jeff Law Message-ID: <00b1bafc-7730-560b-d858-8e4d8660641d@redhat.com> Date: Wed, 19 Oct 2016 20:13: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: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg01581.txt.bz2 On 10/18/2016 12:14 PM, Bernd Edlinger wrote: > On 10/18/16 19:05, Joseph Myers wrote: >> > On Tue, 18 Oct 2016, Bernd Edlinger wrote: >> > >>> >> Hi, >>> >> >>> >> this restricts the -Wint-in-bool-context warning to signed shifts, >>> >> to reduce the number of false positives Markus reported yesterday. >> > >> > This patch seems to be missing testcases (that warned before the patch >> > and don't warn after it). >> > > Yes of course. > > New patch, this time with a test case, compiled from the linux sample. > > Bootstrapped and reg-tested as usual. > Is it OK for trunk? > > > Bernd. > > > patch-bool-context4.diff > > > c-family: > 2016-10-17 Bernd Edlinger > > * c-common.c (c_common_truthvalue_conversion): Warn only for signed > integer shift ops in boolean context. > > testsuite: > 2016-10-17 Bernd Edlinger > > * c-c++-common/Wint-in-bool-context-2.c: New test. Comment please in the code indicating why we're restricting this to signed shifts. I'm not entirely sure I agree with avoiding the warning for this case, but I'm not up for fighting about it. So OK after adding the comment. jeff