HomeFreeBSD

libucl: Const correctness for C23

Description

libucl: Const correctness for C23

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
Reviewed by: bofh, bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D58490

Details

Provenance
ivyAuthored on Aug 3 2026, 2:05 PM
Reviewer
bofh
Differential Revision
D58490: libucl: Const correctness for C23
Parents
rGcb2daf8ce116: rpcgen: Const correctness for C23
Branches
Unknown
Tags
Unknown