On Thu, Dec 15, 2011 at 11:56:32PM +0100, Julia Lawall wrote:
> On Thu, 15 Dec 2011, Josh Triplett wrote:
> >On Thu, Dec 15, 2011 at 12:11:32PM +0100, Julia Lawall wrote:
> >>So I think the best solution would be to stick with the separate ==
> >>and != rules.
> >
> >I guess I'd hope that an isomorphism could determine the equivalence
> >between:
> >
> >@@ ... @@
> >- variable == 0
> >+ condition
> >
> >and
> >
> >@@ ... @@
> >- variable != 0
> >+ !condition
> >
> >.  That seems like a fairly simple equivalence (possibly by way of an
> >isomorphism between !(variable == 0) and (variable != 0)).
> 
> It's quite a nice idea, but currently the isomorphisms only affect
> the matching part of the code.

So why does it sometimes partially work?  In particular, writing the
patch with ==0 worked for both negative cases and the simpler positive
case, and writing it with !=0 worked for all cases but produced double
negatives in the negative cases.

- Josh Triplett
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to