On Sun, 19 Jul 2015, SF Markus Elfring wrote:

> >>> @@
> >>> type T;
> >>> T x;
> >>
> >> Would the specification "type x" be also sufficient?
> > 
> > Not at all.  That would make x be a type.  You want it to be an 
> > expression, of some type.
> 
> It seems that I do not understand this distinction at the moment.
> 
> I would interpret this part more in the way that a SmPL metavariable
> is simply renamed from "T" to "x".

typedef int mytype;

mytype x;

Clearly this would not be the same as

typedef int x;

> 
> 
> >>> identifier f;
> >>> void v;
> >>> @@
> >>>
> >>> (
> >>> f(...)@v;
> >>> |
> >>> *f(...)@x;
> >>> )
> >>
> >> Does the first pattern take precedence over the last one
> > 
> > Yes, always.
> 
> Thanks for your clarification.
> 
> 
> I am still unfamiliar with the consequences from the use of 
> variables like "v" and "x" when they are not position variables
> as you suggest in your example script.

They match the closest enclosing expression.

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

Reply via email to