[3/3] conform: Add C23 checks for <limits.h>

Message ID 20250413231200.549774-3-collin.funk1@gmail.com (mailing list archive)
State New
Headers
Series [1/3] conform: Add C23 checks for <stdint.h> |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed

Commit Message

Collin Funk April 13, 2025, 11:11 p.m. UTC
  Signed-off-by: Collin Funk <collin.funk1@gmail.com>
---
 conform/data/limits.h-data | 42 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)
  

Patch

diff --git a/conform/data/limits.h-data b/conform/data/limits.h-data
index 4160f961cd..2a22309d0a 100644
--- a/conform/data/limits.h-data
+++ b/conform/data/limits.h-data
@@ -1,7 +1,13 @@ 
 macro-int-constant CHAR_BIT >= 8
 macro-int-constant SCHAR_MIN {promoted:signed char} <= -127
 macro-int-constant SCHAR_MAX {promoted:signed char} >= 127
+#if defined ISO23
+macro-int-constant SCHAR_WIDTH >= 8
+#endif
 macro-int-constant UCHAR_MAX {promoted:unsigned char} >= 255
+#if defined ISO23
+macro-int-constant UCHAR_WIDTH >= 8
+#endif
 #ifdef __CHAR_UNSIGNED__
 macro-int-constant CHAR_MIN {promoted:char} == 0
 macro-int-constant CHAR_MAX {promoted:char} == UCHAR_MAX
@@ -9,21 +15,55 @@  macro-int-constant CHAR_MAX {promoted:char} == UCHAR_MAX
 macro-int-constant CHAR_MIN {promoted:char} == SCHAR_MIN
 macro-int-constant CHAR_MAX {promoted:char} == SCHAR_MAX
 #endif
+#if defined ISO23
+macro-int-constant CHAR_WIDTH >= 8
+#endif
 macro-int-constant MB_LEN_MAX >= 1
 macro-int-constant SHRT_MIN {promoted:short int} <= -32767
 macro-int-constant SHRT_MAX {promoted:short int} >= 32767
+#if defined ISO23
+macro-int-constant SHRT_WIDTH >= 16
+#endif
 macro-int-constant USHRT_MAX {promoted:unsigned short int} >= 65535
-// The ranges for int and unsigned int are from POSIX.
+#if defined ISO23
+macro-int-constant USHRT_WIDTH >= 16
+#endif
+// The ranges for int and unsigned int are from POSIX, which are greater than
+// those required by ISO C.
 macro-int-constant INT_MAX {int} >= 2147483647
 macro-int-constant INT_MIN {int} <= -2147483647
+#if defined ISO23
+macro-int-constant INT_WIDTH >= 32
+#endif
 macro-int-constant UINT_MAX {unsigned int} >= 4294967295U
+#if defined ISO23
+macro-int-constant UINT_WIDTH >= 32
+#endif
 macro-int-constant LONG_MAX {long int} >= 2147483647L
 macro-int-constant LONG_MIN {long int} <= -2147483647L
+#if defined ISO23
+macro-int-constant LONG_WIDTH >= 32
+#endif
 macro-int-constant ULONG_MAX {unsigned long int} >= 4294967295UL
+#if defined ISO23
+macro-int-constant ULONG_WIDTH >= 32
+#endif
 #if defined ISO99 || defined ISO11 || defined ISO23 || defined XOPEN2K8 || defined POSIX2008
 macro-int-constant LLONG_MIN {long long int} <= -9223372036854775807ll
 macro-int-constant LLONG_MAX {long long int} >= 9223372036854775807ll
+#if defined ISO23
+macro-int-constant LLONG_WIDTH >= 64
+#endif
 macro-int-constant ULLONG_MAX {unsigned long long int} >= 18446744073709551615ull
+#if defined ISO23
+macro-int-constant ULLONG_WIDTH >= 64
+#endif
+#endif
+
+#if defined ISO23
+macro-int-constant BOOL_WIDTH >= 1
+macro-int-constant BOOL_MAX >= 1
+macro-int-constant BITINT_MAXWIDTH >= 64
 #endif
 
 #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined ISO23