This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/45493] New: -Wuninitialized does not warn
- From: "tadhunt at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Sep 2010 03:40:47 -0000
- Subject: [Bug c/45493] New: -Wuninitialized does not warn
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When the first use of an uninitialized variable is inside a loop, no warning is
generated when -Wuninitialized is turned on.
int
main(void)
{
int len, i;
for(i = 0; i < 5; i++) {
printf("%d\n", len); // no warning!
len = 10;
}
return 0;
}
--
Summary: -Wuninitialized does not warn
Product: gcc
Version: 4.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tadhunt at gmail dot com
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45493