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