void has no size, so + is not defined on pointers to it. GCC treats
void-pointer arithmetic as char-pointer arithmetic (i.e. with
multiplier 1), but standard C does not permit this.
Changed code to convert to char * before doing pointer arithmetic.
const T const is not semantically valid. It's equivalent to
const const T, which is more obviously invalid.
Avoid casting away const-ness when we don't mutate the result.
Avoid implicit conversion from signed to unsigned char (add a cast).
We're actually using zlib's Bytef here, which is unsigned char.
void
has no size, so+
is not defined on pointers to it. GCC treats void-pointer arithmetic as char-pointer arithmetic (i.e. with multiplier 1), but standard C does not permit this. Changed code to convert tochar *
before doing pointer arithmetic.const T const
is not semantically valid. It's equivalent toconst const T
, which is more obviously invalid.Bytef
here, which isunsigned char
.