HomeFreeBSD

mkimg: Const correctness for C23

Description

mkimg: 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 mkimg during
the bootstrap build, since it assumes the return value is always
a mutable pointer.

Make the existing 'sep' pointer const to fix the first case, and
for the second, introduce a new non-const pointer for strchr,
since we do modify the result in that case.

MFC after: 1 week
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58493

Details

Provenance
ivyAuthored on Aug 3 2026, 2:08 PM
Reviewer
markj
Differential Revision
D58493: mkimg: Const correctness for C23
Parents
rG2296c39a9ebc: xinstall: Const correctness for C23
Branches
Unknown
Tags
Unknown