Trouble with 64 bit integers in gcc
Posted: Sun Oct 25, 2009 9:59 am
Hello
I'm developing a 64-bit operating system, but I've some trouble handing 64-integers in gcc..
Take this code as an example:
When j exceeds 32-bit, the statement in if fails.. The value given to bit is also incorrect for j larger than 32 (this can be fixed by using 1UL, but the statement in if still fails)
Why can't gcc handle 64-bit integers? And more important, can I get it working?
I'm developing a 64-bit operating system, but I've some trouble handing 64-integers in gcc..
Take this code as an example:
Code: Select all
uint64_t frames = some_value;
for(j = 0; j < 64; j++)
{
uint64_t bit = (1 << j);
if(!(frames & bit))
{
return j;
}
}
Why can't gcc handle 64-bit integers? And more important, can I get it working?