attributes
People ask from time to time about the possibility of matching attributes, such as __read_mostly. It is now (github) possible to match and transform a single such attribute when it comes after the name of a variable in a variable declaration. A possible rule is thus:
@@
identifier i,j;
attribute name __ro_after_init;
@@
*struct i j __ro_after_init =
{ ... };
julia
[Cocci] Addition of support for variable attributes
Quoted 2 lines
It is now (github) possible to match and transform a single such attribute when it comes after the name of a variable in a variable declaration.
This is a nice extension for your software.
How does this information fit to the wording in the manual?
https://github.com/coccinelle/coccinelle/blob/2776ede39f6f4197eaa0fc8344152e5ed07e0ad3/docs/manual/cocci_syntax.tex#L308
??
It is not possible to match or remove an attribute, only to add one. ??
Quoted 1 line
attribute name
__ro_after_init;
Do you imagine any further software evolution if you start the specification of this metavariable type with two words?
Regards,
Markus