Date: Fri, 24 Apr 2026 15:29:13 +0000 From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: c62cae9b53fe - stable/15 - rpctls_impl.c: Use a direct cast to uintptr_t instead of __DECONST Message-ID: <69eb8c49.35b84.335571b4@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c62cae9b53fe2c5e52a185d3ed37f55ef383f064 commit c62cae9b53fe2c5e52a185d3ed37f55ef383f064 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2026-01-21 16:10:53 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2026-04-24 15:26:38 +0000 rpctls_impl.c: Use a direct cast to uintptr_t instead of __DECONST This fixes the build on CHERI architectures where the compiler warns about a direct cast between uint64_t and const void * inside of __DECONST. However, GCC would also complain about this on 32-bit kernels due to uint64_t not being the same size as a pointer. Also, a direct cast to uintptr_t to right-size the cookie value is more direct than using __DECONST given that there is no "const" pointer involved in the expression. Reviewed by: brooks, glebius Obtained from: CheriBSD Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D54797 (cherry picked from commit 5eb1d4eec67685a933cedd5a20fbec86febcd3a9) --- sys/rpc/rpcsec_tls/rpctls_impl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/rpc/rpcsec_tls/rpctls_impl.c b/sys/rpc/rpcsec_tls/rpctls_impl.c index 51fe270b13d9..22ba699a6fab 100644 --- a/sys/rpc/rpcsec_tls/rpctls_impl.c +++ b/sys/rpc/rpcsec_tls/rpctls_impl.c @@ -163,7 +163,7 @@ sys_rpctls_syscall(struct thread *td, struct rpctls_syscall_args *uap) mtx_lock(&rpctls_lock); upsp = RB_FIND(upsock_t, &upcall_sockets, &(struct upsock){ - .so = __DECONST(struct socket *, uap->socookie) }); + .so = (struct socket *)(uintptr_t)uap->socookie }); if (__predict_true(upsp != NULL)) { RB_REMOVE(upsock_t, &upcall_sockets, upsp); /*home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69eb8c49.35b84.335571b4>
