In C and/or C++: is it safe to cast an int to void pointer and back to int again?
Based on the question \"C++: Is it safe to cast pointer to int and later back to po
No. There might be certain circumstances where it appears to work for a certain compiler&settings, and then two years later you spend weeks debugging that something changed and the conversion no longer works as expected.
If you just design your code in a way that doesn't need this sort of behavior (best case avoids use of such conversion at all, worst case use char[]) then you won't have to worry about obscure bugs in the future.