Re: [Cocci] [PATCHv2] coccinelle: Add a script to find unnecessary ifs with no body

2013-11-08 Thread Michal Marek
On 2.11.2013 17:49, Julia Lawall wrote: >> +@r depends on report || context@ >> +expression E; >> +position p; >> +@@ >> +if@p (E) {} > > There should be a * in front of the if, to support context mode. Josh, will you send a v3 with the above fix? Thanks, Michal

Re: [Cocci] [PATCHv2] coccinelle: Add a script to find unnecessary ifs with no body

2013-11-02 Thread Julia Lawall
> +@r depends on report || context@ > +expression E; > +position p; > +@@ > +if@p (E) {} There should be a * in front of the if, to support context mode. julia ___ Cocci mailing list Cocci@systeme.lip6.fr https://systeme.lip6.fr/mailman/listinfo/cocci

[Cocci] [PATCHv2] coccinelle: Add a script to find unnecessary ifs with no body

2013-11-02 Thread Josh Triplett
This script finds code like this, with an unnecessary if: if (foo) {} Provides report mode only, since patching often eliminates conditionals that contain TODO comments or similar. Signed-off-by: Josh Triplett --- v2: Drop patch mode. scripts/coccinelle/misc/unnecessary-if.cocci | 23 +++