On Sat, Jul 12, 2025 at 02:07:40PM +0200, Bruno Haible via Gnulib discussion 
list wrote:
> 2025-07-12  Bruno Haible  <[email protected]>
> 
>       obstack-printf: Fix memory overrun on glibc systems.
>       * m4/obstack.m4 (gl_FUNC_OBSTACK): Define through AC_DEFUN_ONCE.
>       * m4/obstack-printf.m4 (gl_FUNC_OBSTACK_PRINTF): Require
>       gl_FUNC_OBSTACK. Invoke gl_REPLACE_OBSTACK_PRINTF when using the
>       'obstack' replacement code.

When updating m4 branch-1.6 to the latest gnulib (last done in May
2025, so before this patch), I'm now hitting:

/usr/bin/ld: builtin.o: in function `m4_maketemp':
/home/eblake/m4-1.6/src/builtin.c:1625:(.text+0x4128): undefined reference to 
`rpl_obstack_printf'
/usr/bin/ld: /home/eblake/m4-1.6/src/builtin.c:1636:(.text+0x4415): undefined 
reference to `rpl_obstack_printf'
/usr/bin/ld: debug.o: in function `trace_header':
/home/eblake/m4-1.6/src/debug.c:327:(.text+0x1042): undefined reference to 
`rpl_obstack_printf'
/usr/bin/ld: /home/eblake/m4-1.6/src/debug.c:329:(.text+0x1069): undefined 
reference to `rpl_obstack_printf'
/usr/bin/ld: /home/eblake/m4-1.6/src/debug.c:330:(.text+0x1085): undefined 
reference to `rpl_obstack_printf'
/usr/bin/ld: debug.o:/home/eblake/m4-1.6/src/debug.c:332: more undefined 
references to `rpl_obstack_printf' follow

m4 explicitly imports both the obstack and obstack-printf-posix
modules.  Is this a case of a missing corresponding change to
m4/obstack-printf-posix.m4?

Also, I find it a bit funny to have the comment:

dnl Test whether obstack_printf exists and is POSIX compliant.

since POSIX does not specify obstack_printf.  I get what you meant,
but maybe it is better to word as "Test whether obstack_printf exists
and its behavior matches POSIX compliant printf."

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization:  qemu.org | libguestfs.org


Reply via email to