The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=2d76470b7011d0c2f50ae394972976fbca14bc95

commit 2d76470b7011d0c2f50ae394972976fbca14bc95
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2025-08-07 17:44:24 +0000
Commit:     John Baldwin <j...@freebsd.org>
CommitDate: 2025-08-07 18:26:46 +0000

    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 a3368034695b..4f46eab3db89 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 *

Reply via email to