...
Any pointer type may be converted to an integer type. Except as previously specified, the result is implementation defined. If the result cannot be represented in the integer type, the behavior is undefined. The result need not be in the range of values of any integer type.
See also undefined behavior 21 of Annex J.
These issues arise because the mapping functions for converting a pointer to an integer or an integer to a pointer must be consistent with the addressing structure of the execution environment. For example, not all machines have a flat memory model.
...