| Summary: | [fp] "No return, in function returning non-void" for compound statement at the end | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Jens Elmenthaler <jens.elmenthaler> | ||||
| Component: | cdt-codan | Assignee: | Elena Laskavaia <elaskavaia.cdt> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cdtdoug, kosashi, malaperle | ||||
| Version: | 7.0 | ||||||
| Target Milestone: | 8.0.1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 198321 [details]
fix and test
This solves the problem
fixed on cdt.8.0 and head thanks for the patch |
Build Identifier: CDT 8.0 create a fuction with the following code: int main() { { return 0; } } The function is marked as "No return, in function returning non-void" This may look like stupid code in the beginning, but in C/C++ you use nested scopes to control how long a mutex is locked, e.g. int doSomething() { // Some work here { // Begin of a synchronised block. Guard<mutex> guard; // More work... // End of a synchronised block. return 0; } } Reproducible: Always