Page MenuHomeFreeBSD

mkimg: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Sep 12, 7:37 AM
Unknown Object (File)
Fri, Sep 11, 11:36 PM
Unknown Object (File)
Fri, Sep 11, 1:44 PM
Unknown Object (File)
Tue, Sep 8, 9:45 AM
Unknown Object (File)
Tue, Sep 8, 3:50 AM
Unknown Object (File)
Sun, Sep 6, 11:14 AM
Unknown Object (File)
Thu, Sep 3, 6:48 AM
Unknown Object (File)
Wed, Sep 2, 11:10 AM
Subscribers

Details

Summary

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 mking 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
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable