| Summary: | False positive for No return, in function returning non-void | ||
|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Dmitry Smirnov <divis1969> |
| Component: | cdt-codan | Assignee: | CDT Codan Inbox <cdt-codan-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> |
| Severity: | normal | ||
| Priority: | P3 | CC: | cdtdoug, yevshif, zeratul976 |
| Version: | 8.0 | ||
| Target Milestone: | 8.5 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
This is questionable practice. This is deadcode. Why do you have deadcode after return? Should not you fixing it in a first place? I think we should rather give "Dead code" warning here (rather than "No return"). Codan cannot count on perfect code in editor, it is normal to have unfinished unclean pieces of code while editing code under developing. This appears fixed in http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=16037a5f38845acb7194d12d70ba0ed6b5d04b90. fixed |
Build Identifier: The code below produces the warning, but the is a return. int test2( int a ) { return 1; if( a == 1 ) a = 2; } Reproducible: Always