What is the rationale for making intptr_t and uintptr_t optional types?

Viewed 50

The C Standard defines intptr_t and uintptr_t in <stdint.h> this way:

7.20.1.4 Integer types capable of holding object pointers

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.

Why are these types optional?
Are there any examples of architectures where these types cannot be defined?

0 Answers
Related