Page MenuHomeFreeBSD

sort: Const correctness for C23
ClosedPublic

Authored by ivy on Mon, Jul 27, 10:40 PM.
Tags
None
Referenced Files
F165159912: D58491.diff
Thu, Aug 6, 11:48 AM
F165143006: D58491.id.diff
Thu, Aug 6, 9:20 AM
F165071246: D58491.id182854.diff
Wed, Aug 5, 6:45 PM
Unknown Object (File)
Mon, Aug 3, 10:12 AM
Unknown Object (File)
Sat, Aug 1, 6:30 AM
Unknown Object (File)
Fri, Jul 31, 3:54 AM
Unknown Object (File)
Thu, Jul 30, 3:27 AM
Unknown Object (File)
Mon, Jul 27, 11:13 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