This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20644] New: bogus uninitialized warning on unused variable
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Mar 2005 23:39:19 -0000
- Subject: [Bug c++/20644] New: bogus uninitialized warning on unused variable
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The warning below is inappropriate since j can never be used in the function.
$ cat t.cpp && gcc -c -O -W t.cpp
int foo ()
{
int i;
int j;
for ( ; ; ) {
i = 0;
if (0 == i)
break;
}
if (1 == i)
return j;
return 0;
}
t.cpp: In function `int foo()':
t.cpp:4: warning: 'j' might be used uninitialized in this function
--
Summary: bogus uninitialized warning on unused variable
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sebor at roguewave dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: all
GCC host triplet: all
GCC target triplet: all
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20644