From fef0063119b2e756cdf006d5c089552ca4d964ee Mon Sep 17 00:00:00 2001 From: Boris Egorov Date: Tue, 19 Jan 2016 11:42:26 +0600 Subject: libblkid,libmount: Do not use void* in calculations [cppcheck] [libblkid/src/superblocks/zfs.c:179]: (portability) 'label' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [libblkid/src/superblocks/zfs.c:237]: (portability) 'label' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [libblkid/src/topology/topology.c:221]: (portability) 'chn.data' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. [libmount/src/fs.c:153]: (portability) 'old' is of type 'const void *'. When using void pointers in calculations, the behaviour is undefined. [libmount/src/fs.c:154]: (portability) 'new' is of type 'void *'. When using void pointers in calculations, the behaviour is undefined. --- libmount/src/fs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmount/src/fs.c') diff --git a/libmount/src/fs.c b/libmount/src/fs.c index e3b4eee0e..2bab7d6af 100644 --- a/libmount/src/fs.c +++ b/libmount/src/fs.c @@ -150,8 +150,8 @@ static inline int update_str(char **dest, const char *src) static inline int cpy_str_at_offset(void *new, const void *old, size_t offset) { - char **o = (char **) (old + offset); - char **n = (char **) (new + offset); + char **o = (char **) ((char *) old + offset); + char **n = (char **) ((char *) new + offset); if (*n) return 0; /* already set, don't overwrite */ -- cgit v1.2.3-55-g7522