There is no standard-required way to compare arbitrary pointers.
There is no standard-required integer type into which you can cast an arbitrary pointer. (intptr_t etc are technically optional).
It's architecture-specific whether comparing pointers as signed or unsigned is the correct thing to do.
There is no such thing as portable C because of crap like this, only "mostly portable C, eh, good enough".