compiler.h: need to cast a (void *) to (char *) before adding

In the implementation of mempcpy():

Doing arithmetic on (void *) isn't permitted, so we need to cast it to
(char *); it then get automatically converted to void * by the return.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2018-12-26 06:49:18 -08:00
parent a162092532
commit 38a96f0e06

View File

@ -223,7 +223,7 @@ size_t strnlen(const char *s, size_t maxlen);
#ifndef HAVE_MEMPCPY
static inline void *mempcpy(void *dst, const void *src, size_t n)
{
return memcpy(dst, src, n) + n;
return (char *)memcpy(dst, src, n) + n;
}
#endif