This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Unexpected failure-to-warn
- From: Tom St Denis <tstdenis at ellipticsemi dot com>
- To: Thomas Womack <twomack at globalphasing dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 01 Jun 2007 10:40:27 -0400
- Subject: Re: Unexpected failure-to-warn
- References: <Pine.LNX.4.63.0706011534250.14858@laue.globalphasing.com>
Thomas Womack wrote:
>
> #include <iostream>
> using std::cout;
>
> int main(void)
> {
> const int w = w/3;
> }
>
> does not give a 'warning, w may be used uninitialised', even when
> compiled with g++ -Wall, even though that's clearly the case. I ran
> into this in real code - it's a common kind of thinko.
>
> Is this a bug, or am I missing something subtle in the C standard?
It does warn [gcc 4.1.2] if you up the optimization level.
Tom