On 2026-05-08 22:15, Bruno Haible wrote:
Please make sure that a testdir of all of Gnulib still builds:
   $ ./gnulib-tool --create-testdir --dir=../testdir-all --with-c++-tests 
--without-privileged-tests --single-configure `./all-modules`
   $ cd ../testdir-all
   $ ./configure
   $ make
   $ make check

Thanks for the recipe. Should it be in the Gnulib manual?

The GitLab CI, that happened to run 20 minutes after you sent the mail
and that uses gcc-8.3.0 (Debian 10), runs into this compilation error:

With the recipe, I reproduced the problem and installed the attached patch to fix it. The recipe now works for me on both Fedora 44 x86-64 (GCC 16) and on Ubuntu 25.10 (building with GCC 11, the oldest GCC it ships).
From 77e533e9f6c9993ebe34140348a8072e6c6da184 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Fri, 8 May 2026 22:57:46 -0700
Subject: [PATCH] u64: go back to casts for u64init
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lib/u64.h (u64init) [INT_MAX < UINT64_MAX]: Don’t use a compound
literal here, as u64init is intended for use in static
initializers.  Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2026-05/msg00063.html
---
 ChangeLog | 6 ++++++
 lib/u64.h | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index e555d66ed9..b9b20ed8c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2026-05-08  Paul Eggert  <[email protected]>
 
+	u64: go back to casts for u64init
+	* lib/u64.h (u64init) [INT_MAX < UINT64_MAX]: Don’t use a compound
+	literal here, as u64init is intended for use in static
+	initializers.  Problem reported by Bruno Haible in:
+	https://lists.gnu.org/r/bug-gnulib/2026-05/msg00063.html
+
 	regex-tests: pacify -Wshadow
 	* tests/test-regex-en.c (main): Remove unused local.
 	Nest one of the tests, to avoid shadowing the local ‘pat’.
diff --git a/lib/u64.h b/lib/u64.h
index 9274cb8182..cde952fa31 100644
--- a/lib/u64.h
+++ b/lib/u64.h
@@ -47,7 +47,7 @@ extern "C" {
    these operations do.  */
 typedef uint64_t u64;
 # define u64hilo(hi, lo) ((u64) {((u64) {(hi)} << 32) + (lo)})
-# define u64init(hi, lo) u64hilo (hi, lo)
+# define u64init(hi, lo) (((u64) (hi) << 32) + (lo))
 # define u64lo(x) ((u64) {(x)})
 # define u64getlo(x) ((uint32_t) {(x) & UINT32_MAX})
 # define u64size(x) u64lo (x)
-- 
2.51.0

Reply via email to