Re: [Cocci] transform oddity / bug ?

2020-09-02 Thread Joe Perches
On Wed, 2020-09-02 at 22:46 +0200, Julia Lawall wrote: > > On Wed, 2 Sep 2020, Joe Perches wrote: > > > On Sun, 2020-08-30 at 20:41 +0200, Julia Lawall wrote: > > > On Sun, 30 Aug 2020, Joe Perches wrote: > > > > On Sun, 2020-08-30 at 17:46 +0200, Julia Lawall wrote: > > > > > Unfortunately this

Re: [Cocci] transform oddity / bug ?

2020-09-02 Thread Julia Lawall
On Wed, 2 Sep 2020, Joe Perches wrote: > On Wed, 2020-09-02 at 22:46 +0200, Julia Lawall wrote: > > > > On Wed, 2 Sep 2020, Joe Perches wrote: > > > > > On Sun, 2020-08-30 at 20:41 +0200, Julia Lawall wrote: > > > > On Sun, 30 Aug 2020, Joe Perches wrote: > > > > > On Sun, 2020-08-30 at 17:46

Re: [Cocci] transform oddity / bug ?

2020-09-02 Thread Joe Perches
On Sun, 2020-08-30 at 20:41 +0200, Julia Lawall wrote: > On Sun, 30 Aug 2020, Joe Perches wrote: > > On Sun, 2020-08-30 at 17:46 +0200, Julia Lawall wrote: > > > Unfortunately this does not work when the declaration > > is comma terminated and not semicolon terminated. [] > I will have to look

Re: [Cocci] transform oddity / bug ?

2020-09-02 Thread Julia Lawall
On Wed, 2 Sep 2020, Joe Perches wrote: > On Sun, 2020-08-30 at 20:41 +0200, Julia Lawall wrote: > > On Sun, 30 Aug 2020, Joe Perches wrote: > > > On Sun, 2020-08-30 at 17:46 +0200, Julia Lawall wrote: > > > > Unfortunately this does not work when the declaration > > > is comma terminated and

Re: [Cocci] [PATCH] coccinelle: misc: add excluded_middle.cocci script

2020-09-02 Thread Jim Davis
On Wed, Sep 2, 2020 at 8:19 AM Denis Efremov wrote: > > Check for "!A || A && B" condition. It's equivalent to > "!A || B" condition. > > Signed-off-by: Denis Efremov > --- > scripts/coccinelle/misc/excluded_middle.cocci | 40 +++ > 1 file changed, 40 insertions(+) > create

[Cocci] [PATCH] coccinelle: misc: add excluded_middle.cocci script

2020-09-02 Thread Denis Efremov
Check for "!A || A && B" condition. It's equivalent to "!A || B" condition. Signed-off-by: Denis Efremov --- scripts/coccinelle/misc/excluded_middle.cocci | 40 +++ 1 file changed, 40 insertions(+) create mode 100644 scripts/coccinelle/misc/excluded_middle.cocci diff --git

Re: [Cocci] expression without side effects

2020-09-02 Thread Julia Lawall
On Wed, 2 Sep 2020, Denis Efremov wrote: > > > On 9/2/20 3:32 PM, Julia Lawall wrote: > > There is an isomorphism that you can disable: ptr_to_array > > Thanks! > > Anyway, even with ptr_to_array enabled equalizing cmd->dmap[0] and > cmd->dmap[1] looks incorrect to me. Indeed, in looking at

Re: [Cocci] expression without side effects

2020-09-02 Thread Denis Efremov
On 9/2/20 3:32 PM, Julia Lawall wrote: > There is an isomorphism that you can disable: ptr_to_array Thanks! Anyway, even with ptr_to_array enabled equalizing cmd->dmap[0] and cmd->dmap[1] looks incorrect to me. Denis ___ Cocci mailing list

Re: [Cocci] expression without side effects

2020-09-02 Thread Julia Lawall
On Wed, 2 Sep 2020, Denis Efremov wrote: > Hi, > > I'm trying to write a pattern to match expression without side-effects, > i.e expression E but not i++, --i, function call. > > While trying to write it I faced that this expression matches different > array indices. Actually, it's quite

[Cocci] expression without side effects

2020-09-02 Thread Denis Efremov
Hi, I'm trying to write a pattern to match expression without side-effects, i.e expression E but not i++, --i, function call. While trying to write it I faced that this expression matches different array indices. Actually, it's quite unexpected for me: @@ expression E; identifier A; @@ * E->A

Re: [Cocci] [PATCH] coccinelle: ifnullfree: add vfree(), kvfree*() functions

2020-09-02 Thread Julia Lawall
On Wed, 2 Sep 2020, Markus Elfring wrote: > … > > +++ b/scripts/coccinelle/free/ifnullfree.cocci > > @@ -20,8 +20,14 @@ expression E; > > - if (E != NULL) > > ( > >kfree(E); > > +| > > + kvfree(E); > > | > >kfree_sensitive(E); > > +| > > + kvfree_sensitive(E, ...); > > +| > > +

Re: [Cocci] [PATCH] coccinelle: ifnullfree: add vfree(), kvfree*() functions

2020-09-02 Thread Julia Lawall
On Wed, 2 Sep 2020, Denis Efremov wrote: > Extend the list of free functions with kvfree(), kvfree_sensitive(), > vfree(). > > Signed-off-by: Denis Efremov Applied, thanks. julia > --- > scripts/coccinelle/free/ifnullfree.cocci | 11 +-- > 1 file changed, 9 insertions(+), 2

Re: [Cocci] [PATCH] coccinelle: ifnullfree: add vfree(), kvfree*() functions

2020-09-02 Thread Markus Elfring
> Extend the list of free functions with kvfree(), kvfree_sensitive(), > vfree(). How do you think about further software extensions for this source code search pattern? Another example for a corresponding advanced data processing approach: