On Wed, Jun 23, 2010 at 11:23:26PM +0200, Julia Lawall wrote:
> On Wed, 23 Jun 2010, Josh Triplett wrote:
> 
> > I ran into a spacing problem with return and its expression, which in
> > some cases can lead to spatch generating invalid code.
> 
> Thanks for the report.  I will try to fix it shortly.  In the meantime, 
> you can just rewrite it as:
> 
> - return(E);
> + return E;

Thanks, that seems to fix that spacing problem.

> > Also, regarding this semantic patch, I noticed that if I have a return
> > with multiple parentheses, such as "return ((e));", spatch will only
> > remove one set of parentheses.  Does any means exist to tell spatch to
> > apply a particular patch hunk repeatedly until no further matches exist,
> > or do I need to do that manually by re-running spatch?
> 
> No there is currently no way to iterate within spatch.  Iterating on just 
> one rule might not be too hard to add, though...

Fair enough.  With more than one rule, guaranteeing termination seems
more difficult.  With one rule, you could try to verify first that the
result of the rewrite doesn't inherently continue to match that rule,
creating a loop.

- 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