To quote C11 [1], 6.3.2.3.6: > 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. So this is warning about undefined behavior. However, 7.20.1.4 comes to the rescue: > The following type designates a signed integer type with the property that any > valid pointer to void can be converted to this type, then converted back to > pointer to void, and the result will compare equal to the original pointer: > intptr_t > The following type designates an unsigned integer type with the property that > any valid pointer to void can be converted to this type, then converted back > to pointer to void, and the result will compare equal to the original pointer: > uintptr_t > These types are optional. [1] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf