From: Kefu Chai Date: Fri, 25 Apr 2025 15:10:37 +0000 (+0800) Subject: libcephfs_proxy: remove arithmetic on void* X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F62975%2Fhead;p=ceph.git libcephfs_proxy: remove arithmetic on void* this change is created in the same spirit of bb1fa818. when building the tree with clang-21, following warning was raised: ``` /home/kefu/dev/ceph/src/libcephfs_proxy/proxy_async.c:43:9: warning: arithmetic on a pointer to void is a GNU extension [-Wgnu-pointer-arith] 43 | data += iov->iov_len; | ~~~~ ^ 1 warning generated. ``` this change should address this warning by casting a `void*` pointer to `char*` pointer before performing arithmetic operation on it. Signed-off-by: Kefu Chai --- diff --git a/src/libcephfs_proxy/proxy_async.c b/src/libcephfs_proxy/proxy_async.c index 9efe0ff0faf86..9e4f2e3aec885 100644 --- a/src/libcephfs_proxy/proxy_async.c +++ b/src/libcephfs_proxy/proxy_async.c @@ -40,7 +40,7 @@ static int32_t libcephfsd_cbk_nonblocking_rw(proxy_async_t *async, } memcpy(iov->iov_base, data, iov->iov_len); - data += iov->iov_len; + data = (char*)data + iov->iov_len; size -= iov->iov_len; iov++; count--;