]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
libcephfs_proxy: remove arithmetic on void* 62975/head
authorKefu Chai <tchaikov@gmail.com>
Fri, 25 Apr 2025 15:10:37 +0000 (23:10 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 25 Apr 2025 15:13:25 +0000 (23:13 +0800)
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 <tchaikov@gmail.com>
src/libcephfs_proxy/proxy_async.c

index 9efe0ff0faf86979ebdd7f67884c8794a7c5bdc8..9e4f2e3aec8859da74207e4239f2132f86cd0867 100644 (file)
@@ -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--;