197c1cf8fSJulia Lawall/// Find bit operations that include the same argument more than once 297c1cf8fSJulia Lawall//# One source of false positives is when the argument performs a side 397c1cf8fSJulia Lawall//# effect. Another source of false positives is when a neutral value 497c1cf8fSJulia Lawall//# such as 0 for | is used to indicate no information, to maintain the 597c1cf8fSJulia Lawall//# same structure as other similar expressions 697c1cf8fSJulia Lawall/// 797c1cf8fSJulia Lawall// Confidence: Moderate 897c1cf8fSJulia Lawall// Copyright: (C) 2010 Nicolas Palix, DIKU. GPLv2. 997c1cf8fSJulia Lawall// Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2. 1097c1cf8fSJulia Lawall// Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2. 1197c1cf8fSJulia Lawall// URL: http://coccinelle.lip6.fr/ 1297c1cf8fSJulia Lawall// Comments: 13*93f14468SNicolas Palix// Options: --no-includes --include-headers 1497c1cf8fSJulia Lawall 1597c1cf8fSJulia Lawallvirtual context 1697c1cf8fSJulia Lawallvirtual org 1797c1cf8fSJulia Lawallvirtual report 1897c1cf8fSJulia Lawall 1997c1cf8fSJulia Lawall@r expression@ 2097c1cf8fSJulia Lawallexpression E; 2197c1cf8fSJulia Lawallposition p; 2297c1cf8fSJulia Lawall@@ 2397c1cf8fSJulia Lawall 2497c1cf8fSJulia Lawall( 2597c1cf8fSJulia Lawall* E@p 2697c1cf8fSJulia Lawall & ... & E 2797c1cf8fSJulia Lawall| 2897c1cf8fSJulia Lawall* E@p 2997c1cf8fSJulia Lawall | ... | E 3097c1cf8fSJulia Lawall| 3197c1cf8fSJulia Lawall* E@p 3297c1cf8fSJulia Lawall & ... & !E 3397c1cf8fSJulia Lawall| 3497c1cf8fSJulia Lawall* E@p 3597c1cf8fSJulia Lawall | ... | !E 3697c1cf8fSJulia Lawall| 3797c1cf8fSJulia Lawall* !E@p 3897c1cf8fSJulia Lawall & ... & E 3997c1cf8fSJulia Lawall| 4097c1cf8fSJulia Lawall* !E@p 4197c1cf8fSJulia Lawall | ... | E 4297c1cf8fSJulia Lawall) 4397c1cf8fSJulia Lawall 4497c1cf8fSJulia Lawall@script:python depends on org@ 4597c1cf8fSJulia Lawallp << r.p; 4697c1cf8fSJulia Lawall@@ 4797c1cf8fSJulia Lawall 4897c1cf8fSJulia Lawallcocci.print_main("duplicated argument to & or |",p) 4997c1cf8fSJulia Lawall 5097c1cf8fSJulia Lawall@script:python depends on report@ 5197c1cf8fSJulia Lawallp << r.p; 5297c1cf8fSJulia Lawall@@ 5397c1cf8fSJulia Lawall 5497c1cf8fSJulia Lawallcoccilib.report.print_report(p[0],"duplicated argument to & or |") 55