Re: Spurious warning in gcc SVN trunk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Kevin P. Fleming" <kpfleming@xxxxxxxxxx> writes:

> Compiling this as follows:
>
>> $ ~/gcc-trunk/bin/gcc -o test test.c -Wall
>> test.c: In function ‘main’:
>> test.c:23:4: warning: jump skips variable initialization
>> test.c:11:2: note: label ‘TEST_LABEL’ defined here
>> test.c:9:9: note: ‘foo’ declared here
>
> While this warning is completely accurate, it's also spurious, because
> the code that will execute after the jump to TEST_LABEL does not
> reference the local variable 'foo' in the target block at all.
>
> Now, I don't expect anyone to like this code... I've already fixed it up
> to not be so horrifically bad, but it's still perfectly valid and should
> not generate such a warning. Comments?

This was the subject of a long discussion over on gcc@xxxxxxxxxxx, which
ended here:

http://gcc.gnu.org/ml/gcc/2009-06/msg00704.html

If you have something new to contribute, please do.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux