I know that converting a pointer to one int is unsafe, because the pointer can be bigger than the int in some architectures (for instance in x86_64).
But what about converting the pointer to several ints, an array of them? If the pointer size is 2 times bigger than int then convert pointer*
to int[2]
.
The number of needed ints then is ceil(sizeof(pointer*)/sizeof(int))
.
I need to do this because there is a function which takes ints as arguments and I want to pass a pointer to it.