diff options
author | H. Peter Anvin <hpa@zytor.com> | 2018-12-26 06:49:18 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2018-12-26 06:49:18 -0800 |
commit | 38a96f0e069193cf9a2f4483f4120f3460aa9fa0 (patch) | |
tree | 29f3c49c3c099844390f7f169e4556534642b969 /include/compiler.h | |
parent | a162092532b2c1c6e3af688c60e9ce67273632e4 (diff) | |
download | nasm-38a96f0e069193cf9a2f4483f4120f3460aa9fa0.tar.gz |
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/compiler.h')
-rw-r--r-- | include/compiler.h | 2 |
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 |