On 11/16/24 05:23, Bruno Haible wrote:
What is this line meant to test?
   - Support for hex escapes in UTF-8 string literals?
   - Comparison of bool values against int values?

The former. Thanks for reporting that; I installed the attached.
From 69d4a320a06e158d2f1e5df678186f2e84a9f6d2 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Sat, 16 Nov 2024 11:51:23 -0800
Subject: [PATCH] std-gnu23: pacify GCC 15
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-11/msg00140.html
* m4/std-gnu23.m4 (_AC_C_C23_TEST_GLOBALS): Add parens.
While we’re at it, use sizeof so that the expression is a
conforming integer constant expression.
---
 ChangeLog       | 9 +++++++++
 m4/std-gnu23.m4 | 6 ++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b66fe3f4ca..c33d652b07 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-11-16  Paul Eggert  <[email protected]>
+
+	std-gnu23: pacify GCC 15
+	Problem reported by Bruno Haible in:
+	https://lists.gnu.org/r/bug-gnulib/2024-11/msg00140.html
+	* m4/std-gnu23.m4 (_AC_C_C23_TEST_GLOBALS): Add parens.
+	While we’re at it, use sizeof so that the expression is a
+	conforming integer constant expression.
+
 2024-11-16  Bruno Haible  <[email protected]>
 
 	calloc-gnu: Fix bug on 32-bit AIX (regression 2024-11-04).
diff --git a/m4/std-gnu23.m4 b/m4/std-gnu23.m4
index cebf62d283..5b088d2966 100644
--- a/m4/std-gnu23.m4
+++ b/m4/std-gnu23.m4
@@ -1,5 +1,5 @@
 # std-gnu23.m4
-# serial 2
+# serial 3
 
 # Prefer GNU C23 to earlier versions.
 
@@ -425,7 +425,9 @@ int function_with_unnamed_parameter (int) { return 0; }
 
 void c23_noreturn ();
 
-bool use_u8 = !u8"\xFF" == u8'\''x'\'';
+/* Test parsing of string and char UTF-8 literals (including hex escapes).
+   The parens pacify GCC 15.  */
+bool use_u8 = (!sizeof u8"\xFF") == (!u8'\''x'\'');
 
 bool check_that_bool_works = true | false | !nullptr;
 #if !true
-- 
2.34.1

Reply via email to