Page MenuHomeFreeBSD

sort: Const correctness for C23
ClosedPublic

Authored by ivy on Mon, Jul 27, 10:40 PM.
Tags
None
Referenced Files
F167711174: D58491.diff
Sun, Aug 23, 10:09 PM
Unknown Object (File)
Thu, Aug 20, 11:59 PM
Unknown Object (File)
Sun, Aug 16, 1:29 PM
Unknown Object (File)
Tue, Aug 11, 1:26 PM
Unknown Object (File)
Mon, Aug 10, 5:39 PM
Unknown Object (File)
Mon, Aug 10, 5:23 PM
Unknown Object (File)
Sun, Aug 9, 8:04 PM
Unknown Object (File)
Sun, Aug 9, 6:38 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 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 Not Applicable
Unit
Tests Not Applicable