Message ID | AM4PR0701MB2162BF5814EC93A55A678511E4D70@AM4PR0701MB2162.eurprd07.prod.outlook.com |
---|---|
State | New |
Headers | show
Return-Path: <gcc-patches-return-439304-incoming=patchwork.ozlabs.org@gcc.gnu.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3t1Ct25sGXz9sD6 for <incoming@patchwork.ozlabs.org>; Sat, 22 Oct 2016 17:52:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=wqDdcfsL; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; q=dns; s=default; b=nd4rMcgD8/+/NShH4zhmD3VCd3NisUjrL0/KYNzqwWF e7VN60oVkIk4AmKoxLi/zsV5ECXJZTPhRIrgXhjMReaeHfBDFIkzDV3A0jM97p2E RuFIdgvg8XAmGRCYPh5IndXhG+m+7ns06IuWrQjKVe+Rwt4Lr7a1ObRWGp1lTffY = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:references:in-reply-to :content-type:content-id:content-transfer-encoding:mime-version; s=default; bh=UHAWzth2h3JZWUJ5SsRP/ExLfhU=; b=wqDdcfsLyunoVh0sK lRJSCP0skl/WPkwOhMp3DZrpac1K+0c/cPvjJurpv0enw303ut3Mz6Eph3rSwEp/ LTG8MKEuJKTZxvwNUx4dq3ZBrfek6qcmVZl/qrXdiGM8AKNz4CQKbHU1Bpg30iTN So0Wdm7hr5lAL/kWUkexiHz5l4= Received: (qmail 33154 invoked by alias); 22 Oct 2016 06:52:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-patches.gcc.gnu.org> List-Unsubscribe: <mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-help@gcc.gnu.org> Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 33140 invoked by uid 89); 22 Oct 2016 06:52:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=mult_expr, MULT_EXPR, 33276, sk:OPT_Win X-HELO: BLU004-OMC3S22.hotmail.com Received: from blu004-omc3s22.hotmail.com (HELO BLU004-OMC3S22.hotmail.com) (65.55.116.97) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 22 Oct 2016 06:52:43 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com ([65.55.116.74]) by BLU004-OMC3S22.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Fri, 21 Oct 2016 23:52:42 -0700 Received: from DB5EUR03FT021.eop-EUR03.prod.protection.outlook.com (10.152.20.53) by DB5EUR03HT133.eop-EUR03.prod.protection.outlook.com (10.152.20.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.7; Sat, 22 Oct 2016 06:52:40 +0000 Received: from AM4PR0701MB2162.eurprd07.prod.outlook.com (10.152.20.52) by DB5EUR03FT021.mail.protection.outlook.com (10.152.20.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.7 via Frontend Transport; Sat, 22 Oct 2016 06:52:40 +0000 Received: from AM4PR0701MB2162.eurprd07.prod.outlook.com ([10.167.132.147]) by AM4PR0701MB2162.eurprd07.prod.outlook.com ([10.167.132.147]) with mapi id 15.01.0679.006; Sat, 22 Oct 2016 06:52:40 +0000 From: Bernd Edlinger <bernd.edlinger@hotmail.de> To: Martin Sebor <msebor@gmail.com>, Joseph Myers <joseph@codesourcery.com> CC: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>, Jeff Law <law@redhat.com>, Jason Merrill <jason@redhat.com> Subject: Re: [PATCH] Extend -Wint-in-bool-context to warn for multiplications Date: Sat, 22 Oct 2016 06:52:40 +0000 Message-ID: <AM4PR0701MB2162BF5814EC93A55A678511E4D70@AM4PR0701MB2162.eurprd07.prod.outlook.com> References: <AM4PR0701MB21625266E074BC45F9039C4DE4D40@AM4PR0701MB2162.eurprd07.prod.outlook.com> <alpine.DEB.2.20.1610212237290.3740@digraph.polyomino.org.uk> <9adf888a-b07c-2987-bd3d-27458eabaae5@gmail.com> In-Reply-To: <9adf888a-b07c-2987-bd3d-27458eabaae5@gmail.com> authentication-results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=hotmail.de; x-ms-exchange-messagesentrepresentingtype: 1 x-eopattributedmessage: 0 x-microsoft-exchange-diagnostics: 1; DB5EUR03HT133; 6:d0EkhmdkDGSkhJSw+Km9h6HL3IuusuLE4/00mu+cZ6+XorkZk9OqO3O9zNoBwM6/aAfQauhD2Ntxt55QupRzubDyAXAz57IhxLRpQP3VVUPX7gzpYjsdUynhMaLTuyROzXRLm2LIITYiMiR9r49Vke1XxMfmHoC8sEa0TRnaW8nxssWJJy0zHhtkGRlYZPu6xI1yzJVRGJXwMAaIwBgO6YwZ2sQyfC43WDzF9kU3+oQ2SMTQzcoYXOT2k3DOZZUztbrCUgdUBH/4bWARB4ZlsGPCE6R1fx8bHg4pQ7cfCNjeZTf+ZLNo2TwAyEmJsE35; 5:63tQX6foGmKnqGAFDbX3FGI9lBsSpVo3o6EfeL7gcpWqA/t09Q5hsxsLWVxsyd+rXpknc9wkK8aRZIaXwGlZTdwHehz70NTrkhlzv2QUKakTOQDoWjwyUFr51HJLshHSh3g5theFkhVAMQFeRpwGQQYf6CzLfGj2df4sl12zwrw=; 24:SjrSNaG29j4xEUBpTw70IPpItV9AjEpPUYJz5W+phdpR7c3CKQTxDJBJtELPRVjKQ1A+Lo8JRdJx3EGwnM0UsZRtaAN/bqJKys05zdsFYuk=; 7:WzJC2EnjzUDOONCXQUcdQUmbdHakFxM8P6QSxe1P8MuU6K4mpXnraXZ36SeTY09rt9iBU8vE3/AVFmJ1I/Ekn0i4kDBdD++0XAdUTIRSvZhehOcv+RUdH4o3Y8BVGELjSWcmeiwZcWj1Do5JqDjb7wyImP9CAIm6PM7ZjOfaJHRvqm+pv6T/fVa2w4pVSBu7fUY0WUcDA7ItoSUh+9WuvBbA6BjRUoOMgYuqGBhNXnF4pr5CDQ12ZDnYX3UtP+6V/ttDZLEN7SCUZ6zpz2Y6U2BKxW/WMYaQwbFQjBVr3t9XsqVtwV+4hANwkYmM/tJTfkYnEO3ptENs0IK5U72PXuRTLu+aKzig8pS3DakEAaQ= x-forefront-antispam-report: EFV:NLI; SFV:NSPM; SFS:(10019020)(98900003); DIR:OUT; SFP:1102; SCL:1; SRVR:DB5EUR03HT133; H:AM4PR0701MB2162.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; x-ms-office365-filtering-correlation-id: 4beda9d6-471e-427f-c604-08d3fa48034f x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(1601124038)(1603103081)(1601125047); SRVR:DB5EUR03HT133; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(432015012)(82015046); SRVR:DB5EUR03HT133; BCL:0; PCL:0; RULEID:; SRVR:DB5EUR03HT133; x-forefront-prvs: 01039C93E4 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-ID: <943D7302812E1E4E8B5B2BAA32323BE6@eurprd07.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Oct 2016 06:52:40.0099 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR03HT133 |
Index: c-common.c =================================================================== --- c-common.c (revision 241400) +++ c-common.c (working copy) @@ -3327,6 +3327,11 @@ return c_common_truthvalue_conversion (location, TREE_OPERAND (expr, 0)); + case MULT_EXPR: + warning_at (EXPR_LOCATION (expr), OPT_Wint_in_bool_context, + "%<*%> in boolean context, suggest %<&&%> instead"); + break; + case LSHIFT_EXPR: /* We will only warn on signed shifts here, because the majority of false positive warnings happen in code where unsigned arithmetic