On 11/16/24 05:48, Bruno Haible wrote:
This test for <stdbit.h> is not useful, because <stdbit.h> is part of
the C library, not part of the compiler.

As I recall, I drafted that by looking at what's required even for freestanding compilers. Although the platforms you mentioned aren't up to supporting even freestanding C23, as you mentioned we should use the --std=gnu23 option anyway. I installed the attached to do that. Thanks for reporting the problem.
From 45385fc04466776af92873dec2b5de29cf65460d Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Sat, 16 Nov 2024 12:07:34 -0800
Subject: [PATCH] =?UTF-8?q?std-gnu23:=20don=E2=80=99t=20test=20stdbit.h?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Although freestanding C23 compilers must support <stdbit.h>,
some current sort-of-C23 environments lack it.
We still want to use options like -std=gnu23 on such platforms.
Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-11/msg00141.html
* m4/std-gnu23.m4 (_AC_C_C23_TEST_GLOBALS): Do not test stdbit.h.
---
 ChangeLog       | 10 ++++++++++
 m4/std-gnu23.m4 |  5 +----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c33d652b07..131c612ac0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-11-16  Paul Eggert  <egg...@cs.ucla.edu>
+
+	std-gnu23: don’t test stdbit.h
+	Although freestanding C23 compilers must support <stdbit.h>,
+	some current sort-of-C23 environments lack it.
+	We still want to use options like -std=gnu23 on such platforms.
+	Problem reported by Bruno Haible in:
+	https://lists.gnu.org/r/bug-gnulib/2024-11/msg00141.html
+	* m4/std-gnu23.m4 (_AC_C_C23_TEST_GLOBALS): Do not test stdbit.h.
+
 2024-11-16  Paul Eggert  <egg...@cs.ucla.edu>
 
 	std-gnu23: pacify GCC 15
diff --git a/m4/std-gnu23.m4 b/m4/std-gnu23.m4
index 5b088d2966..db48ae5254 100644
--- a/m4/std-gnu23.m4
+++ b/m4/std-gnu23.m4
@@ -1,5 +1,5 @@
 # std-gnu23.m4
-# serial 3
+# serial 4
 
 # Prefer GNU C23 to earlier versions.
 
@@ -463,9 +463,6 @@ static_assert (0 < -uione);
 #include <stddef.h>
 constexpr nullptr_t null_pointer = nullptr;
 
-#include <stdbit.h>
-static_assert (__STDC_ENDIAN_LITTLE__ != __STDC_ENDIAN_BIG__);
-
 static typeof (1 + 1L) two () { return 2; }
 static long int three () { return 3; }
 '
-- 
2.34.1

Reply via email to