1 // FIXME: seems like cocci has problems manipulating the declarations, at least
2 // when there is more than one on the same line. We already need perl to split
3 // up the declarations after the fact, is there another tool we can use to patch
4 // up and match the declarations? In that case we could consider dropping cocci,
5 // or just using it to alter global variable accesses.
8 // - array declarations not properly matched...can fix, but then can't have
9 // multiple declarations on one line
10 // - does not match array initializers
11 // - probably won't fix structure declarations with initialization either
13 // Function prototype looks like variable dec, but has parentheses
21 // Define a local variable as one whose declaration is encased in brackets
42 // global variable is one whose declaration is neither local nor a function
47 position p != { localvardecl.p, funcproto.p };
54 + *var = SMPI_VARINIT_GLOBAL(var, T)
59 + *var = SMPI_VARINIT_GLOBAL_AND_SET(var, T, value)
62 //T@p // FIXME: matches, but complains if more than one decl on a line...
64 //+ *var[size] = SMPI_VARINIT_GLOBAL_ARRAY(T, size)
67 //T@p // FIXME: how to match initializer?
68 //- var[size] = { ... }
69 //+ *var[] = SMPI_VARINIT_GLOBAL_ARRAY_AND_SET(T, size, { ... })
72 //T@p // FIXME: how to match initializer? how to figure out size?
74 //+ *var[] = SMPI_VARINIT_GLOBAL_ARRAY_AND_SET(T, size, { ... }) // size = ?
79 local idexpression lvar;
80 identifier globalvardecl.var;