This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Missing warning about uninitialized variable.
- From: "J.C. Pizarro" <jcpiza at gmail dot com>
- To: "John Love-Jensen" <eljay at adobe dot com>, gcc-help at gcc dot gnu dot org
- Date: Thu, 29 Nov 2007 17:17:57 +0100
- Subject: Re: Missing warning about uninitialized variable.
- References: <998d0e4a0711290748jb1c1441gc483e488443a6214@mail.gmail.com> <C3743DA6.273A8%eljay@adobe.com>
2007/11/29, John Love-Jensen <eljay@adobe.com>:
> Hi J.C.,
>
> Just out of curiosity, what does the 4.2.3 compiler say (if anything) if the
> uninitialized warning is enabled?
>
> $ gcc -O -Wall -o foo foo.c
>
> Thanks,
> --Eljay
>
>
With -O, -O1, -O2, -O3, they print 5 times of value 3
Without optimization, it prints stochasticly random data.
For large projects with uninitialized variables, the behaviour
could be stochasticly flawed as a russian roulette.
J.C.Pizarro