Re: Missing warning about uninitialized variable

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

 



Mikael Vidstedt <mikael.vidstedt@xxxxxxx> writes:

> The following program may make use of an uninitialized variable (gurka):
> 
> int
> main(int argc, char* argv[])
> {
>    int gurka;
> 
>    if(argc == 10) {
>       gurka = 3;
>    }
> 
>    // gurka isn't necessarily initialized here...
>    printf("%d\n", gurka);
> 
>    return 0;
> }
> 
> GCC 4.0 will give a warning when this program is compiled with "-O
> -Wall". GCC 4.1 and 4.2 do not give that warning. I haven't had the
> possibility to try GCC 4.3.
> 
> What say ye?

Sounds like a bug.  Please report it according to
http://gcc.gnu.org/bugs.html.  Thanks.

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