| Summary: | [fp] undeserved "no return in function returning non-void" when using goto | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] CDT | Reporter: | Matt Hargett <matt> | ||||
| Component: | cdt-codan | Assignee: | Elena Laskavaia <elaskavaia.cdt> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Elena Laskavaia <elaskavaia.cdt> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cdtdoug, eclipse.sprigogin, malaperle, nathanb, xcomart, yevshif | ||||
| Version: | 8.0 | ||||||
| Target Milestone: | 8.0.1 | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
reduced sample:
int
fp_goto(int a)
{
if (a) {
goto end;
}
end:
return (a);
}
Created attachment 198323 [details]
fix + test
This solves the problem
fixed in master & 8.0 (hopefully I committed it correctly) thanks for the patch I don't see the change in cdt_8_0. (In reply to comment #4) > I don't see the change in cdt_8_0. My bad. The change is there. *** Bug 347390 has been marked as a duplicate of this bug. *** *** Bug 354433 has been marked as a duplicate of this bug. *** |
Build Identifier: 201105160958 The CERT_Write_key_to_file() method below elicits an undeserved "no return in function returning non-void" warning: class foo { public: foo(); virtual ~foo(); int g(); static int CERT_Write_key_to_file(void) { int error_code = 0; error_code = g(); if (error_code != 0) { goto end; } end: return (error_code); } }; Reproducible: Always