2 /// Remove unneeded variable used to store return value.
4 // Confidence: Moderate
5 // Copyright: (C) 2012 Peter Senna Tschudin, INRIA/LIP6. GPLv2.
6 // URL: http://coccinelle.lip6.fr/
7 // Comments: Comments on code can be deleted if near code that is removed.
8 // "when strict" can be removed to get more hits, but adds false
10 // Options: --no-includes --include-headers
40 @r1 depends on report || org@
51 @script:python depends on report@
57 coccilib.report.print_report(p1[0], "Unneeded variable: \"" + ret + "\". Return \"" + C + "\" on line " + p2[0].line)
59 @script:python depends on org@
65 cocci.print_main("unneeded \"" + ret + "\" variable", p1)
66 cocci.print_sec("return " + C + " here", p2)