Community
Participate
Working Groups
For the following code: bool g(); void h(); int f() { if (g()) h(); else return 0; } Codan does not issue a warning about having no return statement in the if branch. gcc gives a warning about this (with -Wall), shouldn't Codan do it too?
Added support for this. Probably would be a lot more false positives after this fix...
*** cdt cvs genie on behalf of elaskavaia *** Bug 342906 - No warning if only one of an if/else pair has a return statement [*] ReturnCheckerTest.java 1.9 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/ReturnCheckerTest.java?root=Tools_Project&r1=1.8&r2=1.9 [*] ReturnChecker.java 1.22 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/ReturnChecker.java?root=Tools_Project&r1=1.21&r2=1.22