diff options
author | Jukka Laitinen <jukka.laitinen@iki.fi> | 2022-01-19 12:20:17 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2022-01-21 19:28:12 +0300 |
commit | 5d025eb2353550eadbd2fa9b8083a92fe9b07bd9 (patch) | |
tree | d894553a47e62e5224780e2836a4648bc778c9e8 /lib/sbi/sbi_string.c | |
parent | fb688d9e9d4099d6945c9e460b9cd2c8c4d8a29b (diff) | |
download | opensbi-5d025eb2353550eadbd2fa9b8083a92fe9b07bd9.tar.xz |
lib: fix pointer of type 'void *' used in arithmetic
Using "void *" in arithmetic causes errors with strict compiler settings:
"error: pointer of type 'void *' used in arithmetic [-Werror=pointer-arith]"
Avoid these by calculating on "char *" where 1-byte data size is assumed.
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/sbi/sbi_string.c')
-rw-r--r-- | lib/sbi/sbi_string.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sbi/sbi_string.c b/lib/sbi/sbi_string.c index c87bce9..c163f31 100644 --- a/lib/sbi/sbi_string.c +++ b/lib/sbi/sbi_string.c @@ -149,8 +149,8 @@ void *sbi_memmove(void *dest, const void *src, size_t count) count--; } } else { - temp1 = dest + count - 1; - temp2 = src + count - 1; + temp1 = (char *)dest + count - 1; + temp2 = (char *)src + count - 1; while (count > 0) { *temp1-- = *temp2--; |