[riot-devel] coccinelle

Julia Lawall julia.lawall at lip6.fr
Fri May 5 08:41:58 CEST 2017

The following rule finds local variables that are static, but where the
static property is not used, because the variable is initialized before
any use.  There are only two instances of this problem in RIOT at the
moment, in code that doesn't look very important, but perhaps the rule
could be useful in the future, just in case.


@bad exists@
position p;
identifier x;
type T;

static T x at p;
x = <+...x...+>

identifier x;
expression e;
type T;
position p != bad.p;

 T x at p;
 ... when != x
     when strict
?x = e;

More information about the devel mailing list