Blame view

RIOT/dist/tools/coccinelle/force/static.cocci 365 Bytes
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  // remove unused static property of function-local static variable
  // (from Julia Lawall, see https://lists.riot-os.org/pipermail/devel/2017-May/005133.html)
  
  @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;