This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Incorrect warning about uninitialized variable
- From: Michel LESPINASSE <walken at zoy dot org>
- To: gcc at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Date: Sat, 15 Jun 2002 12:39:44 -0700
- Subject: Incorrect warning about uninitialized variable
Hi,
I generated a very small test case with only straight-line code. When
compiling this example with -Wall -O, gcc complains that 'rotate'
might be used uninitialized. This happens with both versions 2.7.2,
2.95, 3.0 and 3.1.
I dont understand how gcc comes to this conclusion, since this is some
very trivial straight-line code.
#include <stdio.h>
int main (void)
{
unsigned long long test, rotate;
test = 0x0123456789abcdefLL;
rotate = (test >> 32) | (test << 32);
printf ("test: %016Lx, rotate: %016Lx\n", test, rotate);
return 0;
}
--
Michel "Walken" LESPINASSE
Is this the best that god can do ? Then I'm not impressed.