This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc -Wunreachable-code option
- From: Axel Freyn <axel-freyn at gmx dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 25 May 2011 15:29:44 +0200
- Subject: Re: gcc -Wunreachable-code option
- References: <31698329.post@talk.nabble.com>
Hi,
On Wed, May 25, 2011 at 05:14:48AM -0700, Vijayaraghavan Murali wrote:
>
> I'm trying to make gcc generate warnings for detecting unreachable code
> in a program using -Wunreachable-code. But it simply doesn't seem to
> work, even for a simple program such as:
> int main() { return 1; return 0; }
>
> I don't find -Wunreachable-code in man gcc, but it doesn't complain if I
> pass the option to it.
>
> I must be clearly missing something trivial here and would appreciate
> any help. I'm using gcc 4.5.2 and installed gcc-opt, if it matters.
The option was removed january 2010 -- so you would need an older gcc.
to get it.
If I remeber correctly, the concerns were about unpredictability due to
different optimization-option.
See the discussion on http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00179.html
Axel