HomeFreeBSD

m4: Const correctness for C23

Description

m4: Const correctness for C23

On some platforms, e.g. Linux Clang 22.1.8 / glibc 2.43, strchr()
now implements the C23 behaviour where passing a const pointer to
strchr() also returns a const pointer. This breaks m4 during the
bootstrap build, since it assumes the return value is always a
mutable pointer.

Since the returned value is never modified, simply make the
temporary const.

MFC after: 1 week
Reviewed by: bapt, dim
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58494

Details

Provenance
ivyAuthored on Aug 3 2026, 2:09 PM
Reviewer
bapt
Differential Revision
D58494: m4: Const correctness for C23
Parents
rG9fd8f5e761ba: mkimg: Const correctness for C23
Branches
Unknown
Tags
Unknown