Matching attributes
Hello Everyone,
I am toying with coccinelle to assist in writing c code. My first try is to automatically free/cleanup local variables when they go out of scope.
This works very well already:
@@
type T;
identifier var;
attribute name autofree;
@@
T var
- autofree
= NULL;
...
++ free(var);
return ...;But this fails:
@@
type T;
identifier var;
attribute name autofree;
@@
T var autofree;
...
++ free(var);
return ...;with
minus: parse error:
File "autofree.cocci", line 7, column 17, charpos = 73 around = ';',
whole content = T var autofree;
What am I doing wrong here?
I tried both with v1.0.8 and latest git.
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci
Quoted 15 lines
But this fails:
@@
type T;
identifier var;
attribute name autofree;
@@T var autofree; ... ++ free(var); return ...;with
Quoted 7 lines
minus: parse error:
File "autofree.cocci", line 7, column 17, charpos = 73 around = ';', whole content = T var autofree;What am I doing wrong here?
I tried both with v1.0.8 and latest git.
Thanks for the report. I will look into it.
julia
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci