On Wed, 27 Oct 2010, Andi Kleen wrote:
>
> Hi,
>
> I hope this is not a stupid question from a smpl newbie.
>
> I want to add something after all local declarations in a function
> which can vary or at the beginning if there are no local variables.
>
> If I use ... it skips too much and I can't do a match on a specific
> declaration because they vary.
>
> How to express that in smpl?
... when != S
{Some statement}
where S is a statement metavariable. {Some statement} might also be
another statement metavariable if you don't know what kind of statement to
expect. There is probably some more complicated way of dealing with
functions that only have declarations and no following statement, but I
guess that would be quite rare.
I think you could also use
... when = D
where D is a declaration metavariable.
julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)