You can use #include <inttypes.h>
and an integer type uintptr_t
, which is defined to be able to be converted from any valid pointer to void
in N1570 7.18.1.4 to avoid the warning.
Node * XOR(Node *a, Node *b){
return (Node *) ((uintptr_t)(a) ^ (uintptr_t)(b));
}
2
solved Cast from pointer to integer of different size warning