Skip to Main content Skip to Navigation
New interface

Pointers and integer types

Jens Gustedt 1 
1 CAMUS - Compilation pour les Architectures MUlti-coeurS
Inria Nancy - Grand Est, ICube - Laboratoire des sciences de l'ingénieur, de l'informatique et de l'imagerie
Abstract : The current C standard has the types [u]intptr_t optional, because at the time it was designed mapping pointer representations onto integer types was a challenge. This situation has much changed over time. Processor architectures with pointer or integer instructions that operate on a number of bits that is not a power of 2 or that present standard integer types with padding are rare. In a search for such architectures we recently only found two platforms that still take advantage of the option not to define [u]intptr_t. Both are platforms with 128 bit pointer types that seem to be stuck in the intmax_t ABI trap, which is 64 bit wide for them. Therefore we think that it is time to do our users a service and to harden C’s integer and pointer model such that the [u]intptr_t types aliases become mandatory. This does not mean that we introduce a flat address space nor that pointer arithmetic can generally be reduced to arithmetic in uintptr_t. A second advantage of being able to rely on uintptr_t is the possibility to make the specifications in the memory model TS 6010 simpler and comprehensible. By the proposed change it will be possible to identify the abstract address that corresponds to a pointer value and the uintptr_t value to which it is converted.
Document type :
Complete list of metadata
Contributor : Jens Gustedt Connect in order to contact the contributor
Submitted on : Monday, October 4, 2021 - 10:50:58 AM
Last modification on : Friday, October 28, 2022 - 3:46:38 PM


Distributed under a Creative Commons Attribution 4.0 International License


  • HAL Id : hal-03363711, version 1


Jens Gustedt. Pointers and integer types. [Research Report] N2889, ISO JCT1/SC22/WG14. 2022. ⟨hal-03363711⟩



Record views


Files downloads