From: Paul Eggert Date: Sat, 16 Nov 2024 19:51:23 +0000 (-0800) Subject: std-gnu23: pacify GCC 15 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=69d4a320a06e158d2f1e5df678186f2e84a9f6d2;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index b66fe3f4ca..c33d652b07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2024-11-16 Paul Eggert + + 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 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