mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-09-22 10:43:39 -04:00
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:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user