scripts: coccinelle: boolinit: drop warnings on named constants
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 29 Dec 2018 06:14:16 +0000 (07:14 +0100)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 6 Jan 2019 00:46:51 +0000 (09:46 +0900)
Coccinelle doesn't always have access to the values of named
(#define) constants, and they may likely often be bound to true
and false values anyway, resulting in false positives.  So stop
warning about them.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
scripts/coccinelle/misc/boolinit.cocci

index b0584a33c921491026a01d019f8b77fc3e5fd151..aabb581fab5cd158fa026eb9a10483e535256946 100644 (file)
@@ -136,9 +136,14 @@ position p1;
 @r4 depends on !patch@
 bool b;
 position p2;
+identifier i;
 constant c != {0,1};
 @@
+(
+ b = i
+|
 *b@p2 = c
+)
 
 @script:python depends on org@
 p << r1.p;