This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/4210] should not warning with dead code
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Mar 2006 23:01:41 -0000
- Subject: [Bug middle-end/4210] should not warning with dead code
- References: <bug-4210-955@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from joseph at codesourcery dot com 2006-03-01 23:01 -------
Subject: Re: should not warning with dead code
A workaround is to use ? : and statement expressions instead of "if".
This way, the front-end setting of skip_evaluation disables these
warnings. (skip_evaluation can't be set for if (0) because you can jump
into if (0), whereas jumps into statement expressions are not permitted.
Thus in general you need to parse the whole function body to tell if the
if (0) is dead.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210