Bug 59546
Summary: | Incorrect warnings about code that "will never be executed" | ||
---|---|---|---|
Product: | [Retired] Red Hat Raw Hide | Reporter: | Bill Crawford <billc> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | |
Severity: | low | Docs Contact: | |
Priority: | medium | ||
Version: | 1.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-10-02 19:25:21 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Attachments: |
Description
Bill Crawford
2002-02-10 03:43:08 UTC
Created attachment 45157 [details]
Offending example of source, distilled from a real-life example
Created attachment 45158 [details]
Oddly, NO warning is issued for this case (where the last line IS unreachable due to the two return statements)
Fixed in CVS, will appear in gcc-3.1-0.22. I'm still seeing a warning for the first example, which I'm pretty sure is wrong. [bill@pikachu tmp]$ c++ -W -Wall -Wunreachable-code -O2 -c bug4.c++ bug4.c++: In function `void three(fum*, const char*)': bug4.c++:57: warning: will never be executed bug4.c++:47: warning: will never be executed I am however now getting a valid warning for the second example, as I should: [bill@pikachu tmp]$ c++ -W -Wall -Wunreachable-code -O2 -c bug5.c++ bug5.c++: In function `void three(fum*, const char*)': bug5.c++:56: warning: will never be executed If it'll help I can probably supply some more examples ... I get loads of warnings from some code I'm messing with at the moment. It's horrid code, but works ... Definitely not present in gcc 3.2. |