Page MenuHomeFreeBSD

sort: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:40 PM.
Tags
None
Referenced Files
F175908895: D58491.id182854.diff
Wed, Oct 14, 9:52 AM
F175893880: D58491.id183307.diff
Wed, Oct 14, 6:58 AM
Unknown Object (File)
Sun, Oct 11, 5:04 PM
Unknown Object (File)
Wed, Oct 7, 1:14 AM
Unknown Object (File)
Wed, Oct 7, 1:01 AM
Unknown Object (File)
Tue, Oct 6, 4:27 AM
Unknown Object (File)
Wed, Sep 30, 1:56 PM
Unknown Object (File)
Tue, Sep 29, 6:07 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 sort during
the bootstrap build, since it assumes the return value is always
a mutable pointer.

As the returned pointer is never used to modify the value, fix this
by making the temporary variable const.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 75186
Build 72069: arc lint + arc unit