Incorrect warning about uninitialized variable

Michel LESPINASSE walken@zoy.org
Sat Jun 15 13:30:00 GMT 2002


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.



More information about the Gcc mailing list