> i tried this script
>
> @r@
> position p1;
> identifier  arr;
> constant i , var;
> type T;
> @@
>  T arr[var];

Does this SmPL approach work a bit as you expect?
Which details did not satisfy you so far?


> ... when != (i < var/ )

How do you think about to omit parentheses here?


> ...
> * arr[i]@p1

Would you like to reuse the data from the position variable anywhere?

How do you want to handle scopes for the involved array indexes?
http://en.cppreference.com/w/c/language/scope

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

Reply via email to