Assuming that, for example, void* can be cast to uint32_t and vice-versa is not portable since platforms can have different sizes. Correct types to use are intptr_t and uintptr_t which are 32-bit for all the architectures we care about, and 64-bit for modern OS builds without 32-bit compatibility mode. It also makes it clearer that values are likely cast from pointers.
Assuming that, for example,
void*
can be cast touint32_t
and vice-versa is not portable since platforms can have different sizes. Correct types to use areintptr_t
anduintptr_t
which are 32-bit for all the architectures we care about, and 64-bit for modern OS builds without 32-bit compatibility mode. It also makes it clearer that values are likely cast from pointers.