Hi,

When I build the current sources of m4 (with current gnulib) under Fil-C,
"make check" shows many errors like this one:

+filc safety error: cannot read pointer with null object.
+    pointer: 0x730c54b8f020,<null>
+    expected 8 bytes with ptr aligned to 8 bytes.
+semantic origin:
+    (m4) builtin.c:516:17: define_macro
+check scheduled at:
+    (m4) builtin.c:516:17: define_macro
+    (m4) builtin.c:558:3: m4_define
+    (m4) macro.c:284:7: call_macro (inlined)
+    (m4) macro.c:381:3: expand_macro (inlined)
+    (m4) macro.c:118:9: expand_token
+    (m4) macro.c:68:5: expand_input
+    (m4) m4.c:462:3: process_file
+    (m4) m4.c:772:11: main
+    (libc.so) src/env/__libc_start_main.c:79:7: __libc_start_main
+    (libpizlo.so) <runtime>: start_program
+[2319380] filc panic: thwarted a futile attempt to violate memory safety.

The attached patch fixes them all.

>From 9c868357699b00b963fe97ea1daf27547fe7617b Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Mon, 27 Jul 2026 09:44:01 +0200
Subject: [PATCH] Port to Fil-C.

* src/macro.c (expand_macro): With Fil-C, don't use uintptr_t.
---
 src/macro.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/macro.c b/src/macro.c
index ac7553b4..eba8e0a8 100644
--- a/src/macro.c
+++ b/src/macro.c
@@ -360,7 +360,7 @@ expand_macro (symbol *sym)
   collect_arguments (sym, &argv_stack,
                      use_argc_stack ? &argc_stack : &arguments);
 
-  #ifdef UINTPTR_MAX
+  #if defined UINTPTR_MAX && !defined __FILC__
   typedef uintptr_t uptrchar; /* Pacify gcc -Wcast-align.  */
   #else
   typedef char *uptrchar;
-- 
2.53.0

Reply via email to