Re: [PATCH RFC] coccinelle: tests: if and else branch should probably not be identical

From: Julia Lawall
Date: Fri Jul 22 2016 - 12:55:49 EST


> +virtual context
> +virtual org
> +virtual report
> +
> +@cond@
> +statement S1;
> +position p;
> +@@
> +
> +<+...
> +* if@p (...) S1 else S1
> +...+>

You don't need the <+... ...+>. Just put the if by itself.

julia

> +
> +@script:python depends on org@
> +p << cond.p;
> +@@
> +
> +cocci.print_main("WARNING: possible condition with no effect (if == else)",p)
> +
> +@script:python depends on report@
> +p << cond.p;
> +@@
> +
> +coccilib.report.print_report(p[0],"WARNING: possible condition with no effect (if == else)")
> --
> 2.1.4
>
>