This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/23805] No warning for uninitialized variable.
- From: "mike at codeweavers dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2005 02:04:35 -0000
- Subject: [Bug c/23805] No warning for uninitialized variable.
- References: <20050910020033.23805.mike@codeweavers.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From mike at codeweavers dot com 2005-09-10 02:04 -------
char *foo(char **x) { if(*x) return x[0]; return 0; }
char *bar(void) { char *x, *y = 0; if(x) y = foo(&x); return y; }
/usr/local/gcc-4.0.1/bin/gcc -Wall -O2 -Wuninitialized -c tg.c
Give no warnings at all, even though x is used without initialization.
bash-3.00$ /usr/local/gcc-4.0.1/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.1/configure --prefix=/usr/local/gcc-4.0.1
--with-gnu-ld=/usr/local/binutils-2.16.1/bin/ld
--with-gnu-as=/usr/local/binutils-2.16.1/bin/as
Thread model: posix
gcc version 4.0.1
bash-3.00$ uname -a
Linux black 2.6.13 #4 Mon Aug 29 12:35:27 KST 2005 i686 unknown unknown GNU/Linux
Slackware current, built gcc 4.0 myself to check gcc 4.0 warnings in Wine.
--
What |Removed |Added
----------------------------------------------------------------------------
Version|4.1.0 |4.0.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23805