From 4acf0090cf31cbde99bb64d8024f5f4bc90a6296 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 13 Sep 2022 15:56:38 -0500 Subject: [PATCH] =?UTF-8?q?Document=20ISO=20C23=E2=80=99s=20types=20wider?= =?UTF-8?q?=20than=20intmax=5Ft?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manual/arith.texi | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/manual/arith.texi b/manual/arith.texi index edb9cfdafb..83f3e7607b 100644 --- a/manual/arith.texi +++ b/manual/arith.texi @@ -96,7 +96,8 @@ one of these: @item uint_fast64_t @end itemize -If you want an integer with the widest range possible on the platform on +If you want an integer that ordinarily has 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. @@ -106,6 +107,18 @@ of the integer. @item uintmax_t @end itemize +Draft @w{ISO C23} allows for signed integer types wider than @code{intmax_t}. +These include signed bit-precise integer types and extended integer +types that are wider than @code{long long} and that are referred by the +type definition for an exact width integer type. For example, if +@code{intmax_t} is equivalent to @code{long long} and is 64 bits, +the signed bit-precise integer type @code{_BitInt (128)} and the +typedef @code{int128_t}, if they exist, are wider than @code{intmax_t}. +However, @theglibc{} avoids wider-than-@code{intmax_t} types +and it is safe to convert to @code{intmax_t} any signed integer value +documented as being generated or used by @theglibc{}, and similarly +for @code{uintmax_t} and unsigned integer values. + @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}, -- 2.37.2