[PATCH] conform: add ISO23 data for limits.h, stdint.h, inttypes.h
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Mon Nov 23 13:00:44 GMT 2026
Joseph's comment still applies.
On 21/10/26 08:30, Andreas Schwab wrote:
>
> ---
> conform/data/inttypes.h-data | 21 +++++++++++++++++++++
> conform/data/limits.h-data | 20 ++++++++++++++++++++
> conform/data/stdint.h-data | 33 +++++++++++++++++++++++++++++++++
> 3 files changed, 74 insertions(+)
>
> diff --git a/conform/data/inttypes.h-data b/conform/data/inttypes.h-data
> index 2ae5b951be..12931aafaf 100644
> --- a/conform/data/inttypes.h-data
> +++ b/conform/data/inttypes.h-data
> @@ -172,6 +172,27 @@ macro SCNoPTR
> macro SCNuPTR
> macro SCNxPTR
>
> +#if defined ISO23
> +macro PRIB8
Only the uppercase PRIB* macros are checked. The lowercase PRIb* and
SCNb* ones (PRIbN, PRIbLEASTN, PRIbFASTN, PRIbMAX, PRIbPTR, and the same
with SCNb) are missing.
> +macro PRIBLEAST8
> +macro PRIBFAST8
> +macro PRIB16
> +macro PRIBLEAST16
> +macro PRIBFAST16
> +macro PRIB32
> +macro PRIBLEAST32
> +macro PRIBFAST32
> +macro PRIB64
> +macro PRIBLEAST64
> +macro PRIBFAST64
> +macro PRIBMAX
> +macro PRIBPTR
> +#endif
> +
> allow PRI[Xa-z]*
> allow SCN[Xa-z]*
> +#if defined ISO23
> +allow PRIB*
> +#endif
> +
> #endif
> diff --git a/conform/data/limits.h-data b/conform/data/limits.h-data
> index 95202cb386..462173be05 100644
> --- a/conform/data/limits.h-data
> +++ b/conform/data/limits.h-data
> @@ -25,6 +25,23 @@ macro-int-constant LLONG_MIN {long long int} <= -9223372036854775807ll
> macro-int-constant LLONG_MAX {long long int} >= 9223372036854775807ll
> macro-int-constant ULLONG_MAX {unsigned long long int} >= 18446744073709551615ull
> #endif
> +#if defined ISO23
> +macro-int-constant BOOL_MAX {promoted:bool} == 1
> +
> +macro-int-constant BOOL_WIDTH == 1
> +macro-int-constant CHAR_WIDTH == CHAR_BIT
> +macro-int-constant SCHAR_WIDTH == CHAR_BIT
> +macro-int-constant UCHAR_WIDTH == CHAR_BIT
> +macro-int-constant SHRT_WIDTH == USHRT_WIDTH
> +macro-int-constant USHRT_WIDTH >= 16
> +macro-int-constant INT_WIDTH == UINT_WIDTH
> +macro-int-constant UINT_WIDTH >= 16
> +macro-int-constant LONG_WIDTH == ULONG_WIDTH
> +macro-int-constant ULONG_WIDTH >= 32
> +macro-int-constant LLONG_WIDTH == ULLONG_WIDTH
> +macro-int-constant ULLONG_WIDTH >= 64
> +macro-int-constant BITINT_MAXWIDTH >= ULLONG_WIDTH
> +#endif
>
> #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined ISO23
> // if these values exist, we should check the minimal value
> @@ -196,5 +213,8 @@ allow *_MAX
> #if !defined POSIX && !defined XPG4 && !defined XPG42 && !defined UNIX98
> allow *_MIN
> #endif
> +#if defined ISO23
> +allow *_WIDTH
> +#endif
> allow *_t
> #endif
In limits.h-data this is inside the "#if !defined ISO && !defined ISO99
&& !defined ISO11 && !defined ISO23" block, so it is never used for
ISO23. All the *_WIDTH macros are checked explicitly anyway, so I would
drop it.
> diff --git a/conform/data/stdint.h-data b/conform/data/stdint.h-data
> index 5d65d4ecd5..6269f6ec2e 100644
> --- a/conform/data/stdint.h-data
> +++ b/conform/data/stdint.h-data
> @@ -110,10 +110,43 @@ macro UINT64_C
> macro INTMAX_C
> macro UINTMAX_C
>
> +#if defined ISO23
> +macro-int-constant INT8_WIDTH == 8
> +macro-int-constant INT16_WIDTH == 16
> +macro-int-constant INT32_WIDTH == 32
> +macro-int-constant INT64_WIDTH == 64
> +macro-int-constant UINT8_WIDTH == 8
> +macro-int-constant UINT16_WIDTH == 16
> +macro-int-constant UINT32_WIDTH == 32
> +macro-int-constant UINT64_WIDTH == 64
> +
> +macro-int-constant INT_LEAST8_WIDTH == UINT_LEAST8_WIDTH
> +macro-int-constant INT_LEAST16_WIDTH == UINT_LEAST16_WIDTH
> +macro-int-constant INT_LEAST32_WIDTH == UINT_LEAST32_WIDTH
> +macro-int-constant INT_LEAST64_WIDTH == UINT_LEAST64_WIDTH
> +macro-int-constant UINT_LEAST8_WIDTH >= 8
> +macro-int-constant UINT_LEAST16_WIDTH >= 16
> +macro-int-constant UINT_LEAST32_WIDTH >= 32
> +macro-int-constant UINT_LEAST64_WIDTH >= 64
C23 also has the widths of the fastest minimum-width types, which glibc
defines. These pass:
macro-int-constant INT_FAST8_WIDTH == UINT_FAST8_WIDTH
macro-int-constant INT_FAST16_WIDTH == UINT_FAST16_WIDTH
macro-int-constant INT_FAST32_WIDTH == UINT_FAST32_WIDTH
macro-int-constant INT_FAST64_WIDTH == UINT_FAST64_WIDTH
macro-int-constant UINT_FAST8_WIDTH >= 8
macro-int-constant UINT_FAST16_WIDTH >= 16
macro-int-constant UINT_FAST32_WIDTH >= 32
macro-int-constant UINT_FAST64_WIDTH >= 64
> +
> +macro-int-constant INTPTR_WIDTH == UINTPTR_WIDTH
> +macro-int-constant UINTPTR_WIDTH >= 16
> +macro-int-constant INTMAX_WIDTH == UINTMAX_WIDTH
> +macro-int-constant UINTMAX_WIDTH >= 64
> +macro-int-constant PTRDIFF_WIDTH >= 16
> +macro-int-constant SIG_ATOMIC_WIDTH >= 8
> +macro-int-constant SIZE_WIDTH >= 16
> +macro-int-constant WCHAR_WIDTH >= 8
> +macro-int-constant WINT_WIDTH >= 16
> +#endif
> +
> // The following expressions are not entirely correct but the current
> // poorfnmatch implementation doesn't grok the right forms (INT*_MAX,
> // INT*_MIN, INT*_C, UINT*_MAX, UINT*_MIN, UINT*_C, int*_t, uint*_t).
> allow INT*
> allow UINT*
> allow *_t
> +#if defined ISO23
> +allow *_WIDTH
> +#endif
> #endif
More information about the Libc-alpha
mailing list