How safe would it be to do the following cast considering that the size of the pointer varies? (32/64 bits) Could it lead to incorrect program behavior?
#define APL 1
#define GRP 2
void *fruits[][2] = {
{"Apples", (void *) APL},
{"Grapes", (void *) GRP},
};
That plays no role, the standard allows casting integers to pointers.
But the result of the cast is (apart from a constant expression evaluating to 0) implementation-defined, and probably not a pointer to memory you are allowed to manipulate or even read.
If you use these pointers (cast to other pointer types and dereference the result, for example), that can lead to undefined behaviour, and cause various sorts of bad behaviour.