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.

julia

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

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

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

-static
 T x@p;
 ... when != x
     when strict
?x = e;
_______________________________________________
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel

Reply via email to