Re: [Cocci] Goto Directionality?

2014-08-05 Thread Julia Lawall
On Tue, 5 Aug 2014, Mitchell Cuddie wrote: > Hi Julia, > > I am attempting to create a patch to identify the direction of a goto > statement.(i.e. label before/after goto) > > but the patch matches both? > > In my eyes a should match but b should not > > Cheers, > > Mitchell > > > @r @ >

[Cocci] Goto Directionality?

2014-08-05 Thread Mitchell Cuddie
Hi Julia, I am attempting to create a patch to identify the direction of a goto statement.(i.e. label before/after goto) but the patch matches both? In my eyes a should match but b should not Cheers, Mitchell @r @ identifier i; position p; @@ * i@p: ... * goto i; diff = --- test.c +++ /tmp

Re: [Cocci] [PATCH] Coccinelle: Script to replace if and BUG with BUG_ON

2014-08-05 Thread Julia Lawall
On Tue, 5 Aug 2014, Michal Marek wrote: > On 2014-07-20 23:36, Himangi Saraogi wrote: > > This script detects cases where BUG() follows an if condition on an > > expression and replaces the if condition and BUG() with a BUG_ON having > > the conditional expression of the if statement as argument

Re: [Cocci] [PATCH] Coccinelle: Script to replace if and BUG with BUG_ON

2014-08-05 Thread Michal Marek
On 2014-07-20 23:36, Himangi Saraogi wrote: > This script detects cases where BUG() follows an if condition on an > expression and replaces the if condition and BUG() with a BUG_ON having > the conditional expression of the if statement as argument. > > Signed-off-by: Himangi Saraogi > Acked-by:

Re: [Cocci] unreadable files

2014-08-05 Thread Julia Lawall
A better patch is below. julia diff --git a/cocci.ml b/cocci.ml index e67f5ba..5fc6ed0 100644 --- a/cocci.ml +++ b/cocci.ml @@ -516,7 +516,13 @@ let worth_trying2 cfiles (tokens,_,query,_) = res let worth_trying a b = - Common.profile_code "worth_trying" (fun () -> worth_trying2 a b) + Co

Re: [Cocci] unreadable files

2014-08-05 Thread Julia Lawall
Hmm, that patch ay not be enough... julia On Tue, 5 Aug 2014, Akos PASZTORY wrote: > Currently if coccinelle meets a file that it cannot open (e.g. it's an > dangling symlink), it exits with: > Fatal error: exception Sys_error("/tmp/aa/what.c: No such file or directory") > even if run in recursi

Re: [Cocci] unreadable files

2014-08-05 Thread Julia Lawall
Could you try the following patch? julia diff --git a/commons/common.ml b/commons/common.ml index 9914c44..a8ee414 100644 --- a/commons/common.ml +++ b/commons/common.ml @@ -3505,6 +3505,19 @@ let (with_open_infile: filename -> ((in_channel) -> 'a) -> 'a) = fun file f -> res) (fun e ->

Re: [Cocci] unreadable files

2014-08-05 Thread Peter Senna Tschudin
I think ignoring files it can't open can be default behavior. Maybe print a warning? On Tue, Aug 5, 2014 at 12:49 PM, Julia Lawall wrote: > On Tue, 5 Aug 2014, Akos PASZTORY wrote: > >> Currently if coccinelle meets a file that it cannot open (e.g. it's an >> dangling symlink), it exits with: >>

Re: [Cocci] unreadable files

2014-08-05 Thread Julia Lawall
On Tue, 5 Aug 2014, Akos PASZTORY wrote: > Currently if coccinelle meets a file that it cannot open (e.g. it's an > dangling symlink), it exits with: > Fatal error: exception Sys_error("/tmp/aa/what.c: No such file or directory") > even if run in recursive mode (i.e. passing a directory as argumen

[Cocci] unreadable files

2014-08-05 Thread Akos PASZTORY
Currently if coccinelle meets a file that it cannot open (e.g. it's an dangling symlink), it exits with: Fatal error: exception Sys_error("/tmp/aa/what.c: No such file or directory") even if run in recursive mode (i.e. passing a directory as argument). Could you please add a command line option to