From mboxrd@z Thu Jan 1 00:00:00 1970 From: a.hajda@samsung.com (Andrzej Hajda) Date: Wed, 23 Sep 2015 09:34:35 +0200 Subject: [Cocci] [PATCH v3] coccinelle: tests: unsigned value cannot be lesser than zero In-Reply-To: <56017374.3080402@users.sourceforge.net> References: <1442831864-25759-1-git-send-email-a.hajda@samsung.com> <55FFFFF4.4000007@users.sourceforge.net> <56000777.6060208@samsung.com> <56017374.3080402@users.sourceforge.net> Message-ID: <5602560B.2000601@samsung.com> To: cocci@systeme.lip6.fr List-Id: cocci@systeme.lip6.fr On 09/22/2015 05:27 PM, SF Markus Elfring wrote: >> If you mean adding int to 'unsigned long [long]' types, it does not work. >> For some reason it works only without adding int after long. > Do you get any error message for this SmPL approach? > With which source files do you try the extended SmPL script out? > > Regards, > Markus > No, spatch just does not find everything it should. Sample below: --- test.cocci virtual context @r depends on context@ {unsigned char, unsigned short int, unsigned int, unsigned long int, unsigned long long, size_t} v; @@ *v --- test.c void f() { unsigned long ul; unsigned long int uli; unsigned long long ull; unsigned long long int ulli; ul; uli; ull; ulli; } --- In the example above spatch finds ull, ulli, but not ul and uli. If you add int to unsigned long long, it won't find anything. Regards Andrzej From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrzej Hajda Date: Wed, 23 Sep 2015 07:34:35 +0000 Subject: Re: [PATCH v3] coccinelle: tests: unsigned value cannot be lesser than zero Message-Id: <5602560B.2000601@samsung.com> List-Id: References: <1442831864-25759-1-git-send-email-a.hajda@samsung.com> <55FFFFF4.4000007@users.sourceforge.net> <56000777.6060208@samsung.com> <56017374.3080402@users.sourceforge.net> In-Reply-To: <56017374.3080402@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: cocci@systeme.lip6.fr On 09/22/2015 05:27 PM, SF Markus Elfring wrote: >> If you mean adding int to 'unsigned long [long]' types, it does not work. >> For some reason it works only without adding int after long. > Do you get any error message for this SmPL approach? > With which source files do you try the extended SmPL script out? > > Regards, > Markus > No, spatch just does not find everything it should. Sample below: --- test.cocci virtual context @r depends on context@ {unsigned char, unsigned short int, unsigned int, unsigned long int, unsigned long long, size_t} v; @@ *v --- test.c void f() { unsigned long ul; unsigned long int uli; unsigned long long ull; unsigned long long int ulli; ul; uli; ull; ulli; } --- In the example above spatch finds ull, ulli, but not ul and uli. If you add int to unsigned long long, it won't find anything. Regards Andrzej From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752371AbbIWHfF (ORCPT ); Wed, 23 Sep 2015 03:35:05 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:49408 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751723AbbIWHfD (ORCPT ); Wed, 23 Sep 2015 03:35:03 -0400 X-AuditID: cbfec7f4-f79c56d0000012ee-17-560256240991 Subject: Re: [PATCH v3] coccinelle: tests: unsigned value cannot be lesser than zero To: SF Markus Elfring References: <1442831864-25759-1-git-send-email-a.hajda@samsung.com> <55FFFFF4.4000007@users.sourceforge.net> <56000777.6060208@samsung.com> <56017374.3080402@users.sourceforge.net> Cc: Bartlomiej Zolnierkiewicz , Gilles Muller , Joe Perches , Nicolas Palix , Michal Marek , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, cocci@systeme.lip6.fr From: Andrzej Hajda Message-id: <5602560B.2000601@samsung.com> Date: Wed, 23 Sep 2015 09:34:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-version: 1.0 In-reply-to: <56017374.3080402@users.sourceforge.net> Content-type: text/plain; charset=iso-8859-15 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRmVeSWpSXmKPExsVy+t/xy7oqYUxhBlPvMFtsnLGe1eLHptVs Fuc7lzNbzP55icli9v3HLBZbb0lbXN41h81iTussNotjL5czOXB6HDvWyuyxd0uWx5dV15g9 +rasYvRYv+Uqi8ejZfdZPJpOtbN6fN4kF8ARxWWTkpqTWZZapG+XwJUx5eo39oK57BVf9m5l bWDcwtrFyMkhIWAiMfHwVhYIW0ziwr31bF2MXBxCAksZJY6d+AblPGeUWPhzHTtIlbBAmET3 4vlMXYwcHCICphJ/ToRA1HxnlDjfvIkVxGEWWMwksWbxFzaQBjYBTYm/m2+C2bwCWhLPJk1g ArFZBFQl/kw7AbZaVCBC4tTZt1A1ghI/Jt9jAVnACbRg998EEJNZQFdiwQYPkApmAXmJzWve Mk9gFJiFpGEWQtUsJFULGJlXMYqmliYXFCel5xrqFSfmFpfmpesl5+duYoRExJcdjIuPWR1i FOBgVOLhtfjOGCbEmlhWXJl7iFGCg1lJhPdpAFOYEG9KYmVValF+fFFpTmrxIUZpDhYlcd65 u96HCAmkJ5akZqemFqQWwWSZODilGhj14wM0nbuY/u+tj48Ju3dhka/mJaMTqvf4nZ5OuJN5 zMLqeI/t3Bt7H0tynVnWKhO72OPLXdNqieuq66wPu6v89wj8srLJ8/YpaZk5OdNeVz9mvFz5 9eeZuYLC/u3O0RPdLuSzKzBtbHuesTA9PeH/6t1HdPalX6q5uPVNeczf9Z/n/Va7n5esxFKc kWioxVxUnAgA3sje+YQCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/22/2015 05:27 PM, SF Markus Elfring wrote: >> If you mean adding int to 'unsigned long [long]' types, it does not work. >> For some reason it works only without adding int after long. > Do you get any error message for this SmPL approach? > With which source files do you try the extended SmPL script out? > > Regards, > Markus > No, spatch just does not find everything it should. Sample below: --- test.cocci virtual context @r depends on context@ {unsigned char, unsigned short int, unsigned int, unsigned long int, unsigned long long, size_t} v; @@ *v --- test.c void f() { unsigned long ul; unsigned long int uli; unsigned long long ull; unsigned long long int ulli; ul; uli; ull; ulli; } --- In the example above spatch finds ull, ulli, but not ul and uli. If you add int to unsigned long long, it won't find anything. Regards Andrzej