This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]