Files
freebsd/usr.bin/rpcgen
Lexi Winter cb2daf8ce1 rpcgen: 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 rpcgen during
the bootstrap build, since it assumes the return value is always
a mutable pointer.

For mkfile_output(), the pointed-to value is never modified, so
fix this by making the pointer const as well.

For open_log_file(), the current code modifies the supposedly const
value in-place to remove the filename suffix, which happens to work
but is wrong even in older versions of C.  Change the code to use a
printf "%.*s" format specifier to strip the suffix instead.

MFC after:	1 week
Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D58489
2026-08-03 15:04:16 +01:00
..
…
…