The format llxspecifier expects an argument unsigned long long, but you pass int.
The shift does not give you what you expect, because it ~0results in inta negative value. Thus, the right shift preserves the sign bit, i.e. The bit is 1shifted to the left.
ULL , :
printf("0x%016llx\n", ~0ULL);
printf("0x%016llx\n", ~0ULL >> 1);
printf("0x%016llx\n", 0x00000000ffffffffULL >> 1);
:
0xffffffffffffffff
0x7fffffffffffffff
0x000000007fffffff
, 0 .