[PATCH 2/2] doc: document C23 changes to intmax_t

DJ Delorie dj@redhat.com
Wed Mar 18 01:47:58 GMT 2026


Paul Eggert <eggert@cs.ucla.edu> writes:
> -If you want an integer with the widest range possible on the platform on
> -which it is being used, use one of the following.  If you use these,
> -you should write code that takes into account the variable size and range
> -of the integer.
> +If you want an integer with a wide range, use one of these:

Perhaps "with the widest range of any standard type," ?

>  @itemize @bullet
>  @item intmax_t
>  @item uintmax_t
>  @end itemize
>  
> +@noindent
> +The @code{intmax_t} type is wide enough to hold any signed integer value,
> +with the possible exceptions of signed bit-precise integer types,
> +and of @code{int@var{N}_t} types that are wider than @code{long long int}.
> +Compilers may also support other integer types wider than
> +@code{intmax_t}, such as GCC's @code{__int128}.
> +The @code{uintmax_t} type is like @code{intmax_t},
> +except for unsigned integers.
> +
> +Code that uses @code{intmax_t} or @code{uintmax_t} should take into
> +account the variable size, range and alignment of the types.
> +For example, it is unwise for a public interface to rely on @code{intmax_t},
> +as the interface's ABI can change if a different compiler
> +defines @code{intmax_t} differently.
> +
>  @Theglibc{} also provides macros that tell you the maximum and
>  minimum possible values for each integer data type.  The macro names
>  follow these examples: @code{INT32_MAX}, @code{UINT8_MAX},

Otherwise LGTM
Reviewed-by: DJ Delorie <dj@redhat.com>



More information about the Libc-alpha mailing list