| Summary: | [fn] No warning if only one of an if/else pair has a return statement | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Nathan Ridge <zeratul976> |
| Component: | cdt-codan | Assignee: | Elena Laskavaia <elaskavaia.cdt> |
| Status: | RESOLVED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug |
| Version: | 8.0 | ||
| Target Milestone: | 8.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
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 |
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?