1 // SPDX-License-Identifier: GPL-2.0-only
2 /// Find &&/|| operations that include the same argument more than once
3 //# A common source of false positives is when the expression, or
4 //# another expresssion in the same && or || operation, performs a
7 // Confidence: Moderate
8 // Copyright: (C) 2010 Nicolas Palix, DIKU.
9 // Copyright: (C) 2010 Julia Lawall, DIKU.
10 // Copyright: (C) 2010 Gilles Muller, INRIA/LiP6.
11 // URL: http://coccinelle.lip6.fr/
13 // Options: --no-includes --include-headers
31 expression r.E,e1,e2,fn;
33 assignment operator op;
39 <+... \(fn(...)\|e1 op e2\|e1++\|e1--\|++e1\|--e1\) ...+>
42 @depends on context && !bad@
49 @script:python depends on org && !bad@
53 cocci.print_main("duplicated argument to && or ||",p)
55 @script:python depends on report && !bad@
59 coccilib.report.print_report(p[0],"duplicated argument to && or ||")