From 2d76470b7011d0c2f50ae394972976fbca14bc95 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 7 Aug 2025 13:44:24 -0400 Subject: [PATCH] zfs: Fix build with GCC on 32-bit architectures The presence of uint64_t in the expression promotes the entire expression to uint64_t which is larger than uintptr_t on 32-bit plaforms. Note that this also fixes the build for lib32 libraries on 64-bit platforms. sys/contrib/openzfs/include/sys/zio.h: In function 'gbh_eck': sys/contrib/openzfs/include/sys/zio.h:85:17: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 85 | return ((zio_eck_t *)((uintptr_t)gbh + size - sizeof (zio_eck_t))); | ^ --- sys/contrib/openzfs/include/sys/zio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/contrib/openzfs/include/sys/zio.h b/sys/contrib/openzfs/include/sys/zio.h index a3368034695..4f46eab3db8 100644 --- a/sys/contrib/openzfs/include/sys/zio.h +++ b/sys/contrib/openzfs/include/sys/zio.h @@ -82,7 +82,7 @@ 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 *