So, uint64_t unsigned long long match uint64_t in 32-bit compilation, but not in 64-bit compilation?
Yes.
In 32-bit mode, the most probable long is 32 bits, and long long is 64 bits. In 64-bit mode, both are probably 64 bits.
In 32-bit mode, the compiler (more precisely, the <stdint.h> header) defines uint64_t as unsigned long long , because unsigned long not wide enough.
In 64-bit mode, it defines uint64_t as unsigned long .
He could define it as unsigned long long in both modes. The choice is arbitrary; all that is required is that it must be a 64-bit type.
In general, each of the integer types defined in <stdint.h> is a typedef for some predefined type with corresponding characteristics. You cannot assume that any of them is different from the predefined types.
source share