You need to make an integer constant of the correct type. The problem is that 0x100000000 interpreted as int , and casting / assign does not help: the constant itself is too large for int . You must be able to specify that the constant is of type uint64_t :
uint64_t Key = UINT64_C(0x100000000);
will do it. If you do not have UINT64_C , try:
uint64_t Key = 0x100000000ULL;
In fact, in C99 (6.4.4.1p5):
The type of an integer constant is the first of the corresponding list in which its value can be represented.
and a list for hexadecimal constants without any suffix:
int long int unsigned int long int unsigned long int long long int unsigned long long int
So, if you called your compiler in C99 mode, you should not receive a warning (thanks Giles!).
Alok singhal
source share