Page MenuHomeFreeBSD

libucl: Const correctness for C23
ClosedPublic

Authored by ivy on Jul 27 2026, 10:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 1, 7:32 PM
Unknown Object (File)
Tue, Sep 1, 12:35 PM
Unknown Object (File)
Tue, Sep 1, 4:59 AM
Unknown Object (File)
Tue, Sep 1, 4:40 AM
Unknown Object (File)
Mon, Aug 31, 10:38 AM
Unknown Object (File)
Mon, Aug 31, 10:38 AM
Unknown Object (File)
Thu, Aug 27, 5:57 AM
Unknown Object (File)
Mon, Aug 24, 1:52 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 libucl during
the bootstrap build, since it assumes the return value is always
a mutable pointer.

Instead of assigning directly to params->prefix (which is const),
use a non-const temporary variable and assign the result after
we've done the modification.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

Diff Detail

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