This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Strange warnings using egcs-19990718.
- To: gcc at gcc dot gnu dot org
- Subject: Strange warnings using egcs-19990718.
- From: Niels Kristian Bech Jensen <nkbj at image dot dk>
- Date: Mon, 26 Jul 1999 09:18:24 +0200 (CEST)
I get the warning:
warning.c: In function `warning':
warning.c:3: warning: `status' might be used uninitialized in this function
when I compile this piece of code using egcs-19990718 on Red Hat Linux 6.0
(Intel). This is the smallest testcase for the warning, which I originally
found while compiling the Linux kernel.
/*
* This code gives a warning about ``status being used uninitialized''
* when compile with gcc version 2.95 19990718 (prerelease) on Red Hat
* Linux 6.0 (Intel).
*
* Compile with: gcc -Wall -O1 -c warning.c
*/
int warning()
{
int i, status;
for (i = 0; i < 10; i++) {
status = i;
if (status >= 0)
return status;
if (status < 0) break;
}
return status;
}
--
Niels Kristian Bech Jensen -- nkbj@image.dk -- http://www.image.dk/~nkbj/
----------->> Stop software piracy --- use free software! <<-----------