Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1036601ybe; Thu, 5 Sep 2019 09:21:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3QQtTKTKcXcIsloeTaNExeqZQKeGbEhxuqAOU2ne9i3HLXYo/8uV2UErglhrleI4w/z8k X-Received: by 2002:a17:902:bf47:: with SMTP id u7mr4051119pls.77.1567700495718; Thu, 05 Sep 2019 09:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567700495; cv=none; d=google.com; s=arc-20160816; b=Rrq6hNXIZsrKBGEJFQF4BLaZD3YXVXo8WCAdAVULCfzo2IX5x7xw2tsp5A+1kcUkAE 3cfSyu1fo0jCfdOTxPmtYMlkrvsLinjsfu1/b7klMgiwBAnDypN5dRxPEW/9KWXEY7D4 1Ul6YnDmhvZZGSIObqvbljIOmzWFCKKxTN0PRPJ9EbqlVeNBlCElegBRffVfhwSCaJWn ZEbljJNG2XR7XXPXJKFhuaOBg2JLHqMtu5j7oUmPUAk37ADRwG999nKZBYfQt1UQQUMa x17WIsegySK1BdlTGjQSrdFR369yrG2YigtzwQn/JdoNenf5rvsD9Hdkf0EYoUMZ4Goc oENQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:subject:references:cc:to:dkim-signature; bh=JNJwFsVmFVbvOdjac13V4aunkJSVrBZrFuRlL/ORFCM=; b=B2Fx7Xfoj7OwC53i6k6tVnODwxlHMWnpwd+8i8wjdx18TtfpImMosedAdjg4UqtHp4 V78X9k4PD6EOg9clVHKrEHygPez/xtOBNDvrdHdbmkCuHYIix+/hKyEd2DbaVZZD+3QR /2hXXuiOGBKbhy6oVAaXVu0n/Mk2No2O5sjVo6qHDB6LAoUp49YPjEuJNljRnGY7hlr/ HifeMDTYmPAReDKxGWp48zdr/hSUv8r+4Kam8vouz22MyTteioZMQsTh2PU1zSxNRl+W o/MQFPprRZK3lqJpNT9tZGCGJ1jnaAujbf3VV4l4tJvGnvLSkVXjyrUsjJSHRhWppMUu zXsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=IU5uIaah; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j24si2121629pgh.287.2019.09.05.09.21.19; Thu, 05 Sep 2019 09:21:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=dbaedf251592 header.b=IU5uIaah; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388761AbfIEOX4 (ORCPT + 99 others); Thu, 5 Sep 2019 10:23:56 -0400 Received: from mout.web.de ([217.72.192.78]:42193 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725290AbfIEOX4 (ORCPT ); Thu, 5 Sep 2019 10:23:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1567693417; bh=vDcMhGqXGoYNbcDOrEA+uJ9Ezo8bs4BQHB/7eSujz0g=; h=X-UI-Sender-Class:To:Cc:References:Subject:From:Date:In-Reply-To; b=IU5uIaahpZfPBi/DGZ3HZmmSfqzcxaghXF5O8i5tIGmsyIBrw6CqDpvW26HajwD/m tPhisqQqzuPPbFsrMYWChnsP9hGCf+8VCT0ko3fnfWwBVcyJsEuwixA6kSVAO0P5TY pRsfuVqlfep4C0m57uws3dA99Z07NNRYs0pGT/2s= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from [192.168.1.2] ([78.49.131.221]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LfAwe-1iUE3l0XLU-00oooT; Thu, 05 Sep 2019 16:23:37 +0200 To: Denis Efremov , kernel-janitors@vger.kernel.org, cocci@systeme.lip6.fr Cc: linux-kernel@vger.kernel.org, Gilles Muller , Julia Lawall , Masahiro Yamada , Michal Marek , Nicolas Palix References: <20190904221223.5281-1-efremov@linux.com> Subject: Re: [RFC PATCH] coccinelle: check for integer overflow in binary search From: Markus Elfring Autocrypt: addr=Markus.Elfring@web.de; prefer-encrypt=mutual; keydata= mQINBFg2+xABEADBJW2hoUoFXVFWTeKbqqif8VjszdMkriilx90WB5c0ddWQX14h6w5bT/A8 +v43YoGpDNyhgA0w9CEhuwfZrE91GocMtjLO67TAc2i2nxMc/FJRDI0OemO4VJ9RwID6ltwt mpVJgXGKkNJ1ey+QOXouzlErVvE2fRh+KXXN1Q7fSmTJlAW9XJYHS3BDHb0uRpymRSX3O+E2 lA87C7R8qAigPDZi6Z7UmwIA83ZMKXQ5stA0lhPyYgQcM7fh7V4ZYhnR0I5/qkUoxKpqaYLp YHBczVP+Zx/zHOM0KQphOMbU7X3c1pmMruoe6ti9uZzqZSLsF+NKXFEPBS665tQr66HJvZvY GMDlntZFAZ6xQvCC1r3MGoxEC1tuEa24vPCC9RZ9wk2sY5Csbva0WwYv3WKRZZBv8eIhGMxs rcpeGShRFyZ/0BYO53wZAPV1pEhGLLxd8eLN/nEWjJE0ejakPC1H/mt5F+yQBJAzz9JzbToU 5jKLu0SugNI18MspJut8AiA1M44CIWrNHXvWsQ+nnBKHDHHYZu7MoXlOmB32ndsfPthR3GSv jN7YD4Ad724H8fhRijmC1+RpuSce7w2JLj5cYj4MlccmNb8YUxsE8brY2WkXQYS8Ivse39MX BE66MQN0r5DQ6oqgoJ4gHIVBU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MpkauN4CJ5yTpvp+Orcz5KixHQmc5tbkLWf x0n1QFc1xxJhbzN+r9djSGGN/5IBDfUqSANC8cWzHpWaHmSuU3JSAMB/N+yQjIad2ztTckZY pwT6oxng29LzZspTYUEzMz3wK2jQHw+U66qBFk8whA7B2uAU1QdGyPgahLYSOa4XAEGb6wbI FEE= Message-ID: Date: Thu, 5 Sep 2019 16:23:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <20190904221223.5281-1-efremov@linux.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1://RCTpDKoQr1MmnTTPGKGOFQii2zTC+j41g2/gifdw4N6IYu3GW yod9//MASwxVUh5vgQLODg+r8dQRAp7wnjsf/QOHIu5Nnjoel9ZEhJOk7STmkYqYyHu8RPq tfLhXpViqAzQEeR2Z8pYlAouK3cqEvplJJkCT+HaanEwAE4sw/PvBFb1T9e0YGGYVoyuipd Hi54IIEmawgTMe9QD3sCA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:xZW9mIaafbI=:50L862vc6lF0viDcqggF9v tIHH4C3NIgbQfGyzlKNgzLLd07OUmOKZ7eXi5B/hiLAuivZotZ5aPkwd/8a/La05r7gTs/FJq qF7MwaECzkd14USgFmA6RoVLScXWWgteyA5RcTyNEWePL2fi20FbCCIR3UPjxb/LpFjKytZA2 p7liPcCAdgo6eo6Z+pCdNFy69UMOU6mBQUga4zDbOafBL10Epa/eFzYB6ysxXuqhyyTjQiLvj Y42kQVfNKB3luJLbMpPughLPql9Elh9a+uBPb+NCR9/PAcuxJNohj0eG0EUhybdFgouQ5HJDL aCC9lEBCCJXK52Bwy7mdtlDQ7XWg9ieYb6gpf9JR30NSV8VcP5rXyhM7Itm1nQEdMAZmMmaoO EXx2xQ9b7FOQkD5Jv1xc0p5w0NAxDZaXDCbztzXP4DaatfaRRaDKtZ8U6iTTiXIqaAuiRyosV cHYhs+wD5C48vFG0TJ5YqrswU0IYHp9p2Yqr+nov46X72egC11fsTX515M0lqotgtynvh+BCs thMuFNyo2NuN2NLe4jA1yGnLxddN94wJl8e2JJ6/rsZFBxfxN6XDp7Vv7aNyHiSq/3RJJL0RV fayWTRnyTmt23NBqByQ9ozNOCccZxuD7AHf5Wfcydju46cMK+L/7rWOZLEnmIN0DvVGwcw0hs 1vZIYg/21wlyQ0WbAzSUbU8DlTvjDYWF790ZGJ5grLb6s/eOWtvFqbAEgGT0Vq/i2WjhD3AVG ei4UnFCn5PciCDZHY2YcEWRlPgQI3HntGqDWOl23Kqq4pi9IPrP7J8FVc8599rMqpCAB8avjM 7oO6yrU7jnbYCPIv05J/eqP3++6f6P+69ITKDuJXQrHdT8xh6dzR9LkbgssqlKf76zTzkvkuv 2Wft5tdKHMUd1C+9Hp0k/FWkOCm3rda3SIb/lyGkR2tPTCl0ClfiIg4P/qb4OPBMq0zidRtiA hjGkedW1qfsGimDhlCo8QlGzDkq8K1lbTZ5Jqg7sZ96t56gQRsOFGlo1OvT7/40jXfWdz4FP5 cKXWbqHzc1uXMaibDtdOYxGo7XnIOcE7iILDoX2M8S/fnUPPz9HwWyVw8BZUG6bBR3kVvHyb2 gpfIFVKRc6ZSqqiIP3ox6Lwpj72cUeCLncZTrA3Y8lhtwTzeFYWBhF9fr2M1jcpHfbnxrwyST JZOlI0ggJm6vRJYW6ve7LQ8/N1Wyls5De7/ORevP7XMmvUSZYi6itXzcO4WDwY0hute4orXkg 74dFqcndYF2lLX4TB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +@@ > +( > + while (\(=E2=80=A6\)) { =E2=80=A6 > + } It seems that compound statements are mainly checked for control flow statements by this source code search approach so far. Would you like to handle also single statements (without the curly brackets)? (Will additional SmPL disjunctions be needed then?) > +statement S; =E2=80=A6 > +| > + for (...; \(=E2=80=A6\); > + m =3D \(=E2=80=A6\)) S * Can the metavariable =E2=80=9CS=E2=80=9D look nicer on a separate line? * Should assignments be taken into account for more variables? > +| > + for (...; \(=E2=80=A6\); ...) { > + } > +) I find the shown case distinction incomplete. Will loop initialisations trigger further SmPL development challenges? Regards, Markus