aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-12-26 06:49:18 -0800
committerH. Peter Anvin <hpa@zytor.com>2018-12-26 06:49:18 -0800
commit38a96f0e069193cf9a2f4483f4120f3460aa9fa0 (patch)
tree29f3c49c3c099844390f7f169e4556534642b969 /include
parenta162092532b2c1c6e3af688c60e9ce67273632e4 (diff)
downloadnasm-38a96f0e069193cf9a2f4483f4120f3460aa9fa0.tar.gz
nasm-38a96f0e069193cf9a2f4483f4120f3460aa9fa0.tar.xz
nasm-38a96f0e069193cf9a2f4483f4120f3460aa9fa0.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/compiler.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/compiler.h b/include/compiler.h
index 25aeea1e..643e04c2 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -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