> > I'd basically need something like:
> > 
> >     if (... when != var)
> 
> This is not really clear enough for me to understand what you do want to 
> do.  I imagine that you want something like
> 
> (
> if (pattern_you_like) S1 else S2
> |
> * if (pattern_you_dont_like)
>   S1 else S2
> )

Ah, so I was on a good path since I ended up with something similar...

> Where pattern_you_like might be <+... var ...+>, if you like everything 
> that somewhere contains var.

... and this hint made it work, thanks a lot! Before that I was using

        if (var = ...) S

as pattern_I_like. But that never matched and thus always ended up in
the pattern_i_dont_like branch.

> I would really rather that all assignments in if tests disappear,

+1. They are often annoying.

> the if, but it touched over 1100 files in the Linux kernel, so I ran out 
> of courage...

:)

Thanks,

   Wolfram

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to