From: Mathieu Desnoyers Date: Thu, 21 Sep 2023 05:11:28 +0000 (+0100) Subject: Fix clang warning X-Git-Url: http://git.efficios.com/?p=libside.git;a=commitdiff_plain;h=dc9567a6e23c0066e5acdb94fbed4f7b66ce8299 Fix clang warning Clang issues a warning about what we are really intending to do. Use an explicit type as argument to sizeof(). tracer.c:1152:28: warning: 'memcpy' call operates on objects of type 'const char' while the size is based on a different type 'const char *' [-Wsizeof-pointer-memaccess] memcpy(&ptr, ptr, sizeof(ptr)); ~~~ ^~~ tracer.c:1152:28: note: did you mean to provide an explicit length? memcpy(&ptr, ptr, sizeof(ptr)); ^~~ Signed-off-by: Mathieu Desnoyers --- diff --git a/src/tracer.c b/src/tracer.c index 1967e81..a0567cb 100644 --- a/src/tracer.c +++ b/src/tracer.c @@ -1149,7 +1149,7 @@ const char *tracer_gather_access(enum side_type_gather_access_mode access_mode, return ptr; case SIDE_TYPE_GATHER_ACCESS_POINTER: /* Dereference pointer */ - memcpy(&ptr, ptr, sizeof(ptr)); + memcpy(&ptr, ptr, sizeof(const char *)); return ptr; default: abort();