From a2424312c451c6ad31dc62ae04926c8e99ccdc96 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Tue, 9 Sep 2025 09:56:43 -0600 Subject: [PATCH] Fix the build on 32-bit FreeBSD with GCC GCC complains about casting a 64-bit integer to a 32-bit pointer. Originally committed downstream as https://github.com/freebsd/freebsd-src/commit/2d76470b701 Reviewed-by: Alexander Motin Reviewed-by: Brian Behlendorf Reviewed-by: Tony Hutter Signed-off-by: Alan Somers Sponsored by: ConnectWise Closes #17706 --- include/sys/zio.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/sys/zio.h b/include/sys/zio.h index 211a7d0b0..a8acb83b4 100644 --- a/include/sys/zio.h +++ b/include/sys/zio.h @@ -82,7 +82,8 @@ gbh_nblkptrs(uint64_t size) { static inline zio_eck_t * gbh_eck(zio_gbh_phys_t *gbh, uint64_t size) { ASSERT(IS_P2ALIGNED(size, sizeof (blkptr_t))); - return ((zio_eck_t *)((uintptr_t)gbh + size - sizeof (zio_eck_t))); + return ((zio_eck_t *)((uintptr_t)gbh + (size_t)size - + sizeof (zio_eck_t))); } static inline blkptr_t *