Page MenuHomeFreeBSD

mkimg: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:45 PM.
Tags
None
Referenced Files
F169749632: D58493.id182856.diff
Wed, Sep 2, 11:10 AM
F169748134: D58493.id182856.diff
Wed, Sep 2, 11:05 AM
F169580297: D58493.id182856.diff
Tue, Sep 1, 11:36 PM
F169538024: D58493.diff
Tue, Sep 1, 8:50 PM
F169532522: D58493.id183309.diff
Tue, Sep 1, 8:23 PM
F169531567: D58493.id183309.diff
Tue, Sep 1, 8:18 PM
Unknown Object (File)
Mon, Aug 31, 1:03 AM
Unknown Object (File)
Fri, Aug 21, 8:46 PM
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