1 /// Find &&/|| operations that include the same argument more than once
2 //# A common source of false positives is when the expression, or
3 //# another expresssion in the same && or || operation, performs a
6 // Confidence: Moderate
7 // Copyright: (C) 2010 Nicolas Palix, DIKU. GPLv2.
8 // Copyright: (C) 2010 Julia Lawall, DIKU. GPLv2.
9 // Copyright: (C) 2010 Gilles Muller, INRIA/LiP6. GPLv2.
10 // URL: http://coccinelle.lip6.fr/
12 // Options: --no-includes --include-headers
30 expression r.E,e1,e2,fn;
32 assignment operator op;
38 <+... \(fn(...)\|e1 op e2\|e1++\|e1--\|++e1\|--e1\) ...+>
41 @depends on context && !bad@
48 @script:python depends on org && !bad@
52 cocci.print_main("duplicated argument to && or ||",p)
54 @script:python depends on report && !bad@
58 coccilib.report.print_report(p[0],"duplicated argument to && or ||")