Reputation: 2371
With C99 (and later standards) standard requires certain types to be available in the header <stdint.h>
. For exact-width, e.g., int8_t
, int16_t
, etc..., they are optional and motivated in the standard why that is.
But for the uintptr_t
and intptr_t
type, they are also optional but I don't see a reason for them being optional instead of required.
Upvotes: 16
Views: 2099
Reputation: 37549
On some platforms pointer types have much larger size than any integral type. I believe an example of such as platform would be IBM AS/400 with virtual instruction set defining all pointers as 128-bit. A more recent example of such platform would be Elbrus. It uses 128-bit pointers which are HW descriptors rather than normal addresses.
Upvotes: 16