|
Bugzilla – Full Text Bug Listing |
| Summary: | misleading warning of gcc 4.0 | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | Arvin Schnell <aschnell> |
| Component: | Development | Assignee: | Michael Matz <matz> |
| Status: | RESOLVED WONTFIX | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | jengelh |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | All | ||
| Whiteboard: | |||
| Found By: | Development | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
I think this is perfectly fine. Given that the optimizer will probably discard
and not analyze _any code anymore_ after the "return;", you're practically left
with what could be equal to:
int test() {
return;
}
BTW, do you use -O, -O2 or any higher for your testcase?
That's why Arvin agrees that the first warning is okay. And the second warning "control reaches end of non-void function" in a way just repeats the first one, and ergo is useless. Anyway, this is nothing to fix locally in SuSE GCC, so it will come in with some later update to GCC 4.1. mass reopening all SuSE Linux bugs that are set to REMIND+LATER to change the resolution to WONTFIX (adapting to new policy) mass reopening all SuSE Linux bugs that are set to REMIND+LATER to change the resolution to WONTFIX (adapting to new policy) mass reopening all SuSE Linux bugs that are set to REMIND+LATER to change the resolution to WONTFIX (adapting to new policy) Closing old LATER+REMIND bugs as WONTFIX - if you still plan to work on it, feel free to reopen and set to ASSIGNED. In case the report saw repeated reopen comments, it's due to bugzilla timing out on the huge request ;( |
Compiling this little example gives confusing warnings: int test () { return; return 1; } return.c: In function ‘test’: return.c:4: warning: ‘return’ with no value, in function returning non-void return.c:6: warning: control reaches end of non-void function The first warning is ok but the second is simply stupid and misleading.