cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
* [Cocci] [PATCH] scripts: coccinelle: boolinit: drop warnings on named constants
@ 2018-12-29  6:14 Julia Lawall
  2019-01-06  1:41 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2018-12-29  6:14 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Michal Marek, kernel-janitors, Nicolas Palix, linux-kernel,
	Pierre-Louis Bossart, cocci

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>

---
 scripts/coccinelle/misc/boolinit.cocci |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/coccinelle/misc/boolinit.cocci b/scripts/coccinelle/misc/boolinit.cocci
index b0584a3..aabb581 100644
--- a/scripts/coccinelle/misc/boolinit.cocci
+++ b/scripts/coccinelle/misc/boolinit.cocci
@@ -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;

_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-06  2:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29  6:14 [Cocci] [PATCH] scripts: coccinelle: boolinit: drop warnings on named constants Julia Lawall
2019-01-06  1:41 ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).