Thanks for reporting that issue in
<https://lists.gnu.org/r/bug-m4/2026-06/msg00000.html>. Unfortunately I
didn't notice it until now, as somehow I was not subscribed to bug-m4;
I've fixed that.
I reproduced something similar on Fedora 44 with clang, and installed
the attached patch on Savannah on branch-1.4. I hope this fixes the
macOS issue. The only macOS host on cfarm.net is down, so I can't easily
test this directly.From fa497d17c6ffd2971702bd035f042d53a11a0cfd Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Fri, 10 Jul 2026 21:24:50 -0700
Subject: [PATCH] m4: port to clang ckd_add
Problem reported by Bruno Haible in:
https://lists.gnu.org/archive/html/bug-m4/2026-06/index.html
* src/builtin.c (m4_eval):
* src/symtab.c (hash): Port to clang, which insists on ckd_*
arguments not being bool or plain char.
---
src/builtin.c | 2 +-
src/symtab.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/builtin.c b/src/builtin.c
index 217ca30a..6790f5f5 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -1204,7 +1204,7 @@ m4_eval (struct obstack *obs, idx_t argc, token_data **argv)
}
idx_t alloc;
- if (ckd_sub (&alloc, negative, MIN (negdigits, -min)) || SIZE_MAX < alloc)
+ if (ckd_sub (&alloc, +negative, MIN (negdigits, -min)) || SIZE_MAX < alloc)
xalloc_die ();
obstack_blank (obs, alloc);
diff --git a/src/symtab.c b/src/symtab.c
index 828056e7..37309c8b 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -126,7 +126,7 @@ hash (const char *s)
{
size_t val = 0;
for (; *s; s++)
- ckd_add (&val, stdc_rotate_left (val, 7), *s);
+ ckd_add (&val, stdc_rotate_left (val, 7), +*s);
return val;
}
--
2.53.0