From a6cf564a85759d8de089f6c078fe5f6dec8d414c Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 7 Sep 2021 11:29:46 -0400 Subject: [PATCH] Fix #1141, add typecast to memchr call This function is documented as returning `void*`, and on some compilers this requires an explicit cast to `const char*` to avoid a warning. --- src/os/shared/inc/os-shared-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/shared/inc/os-shared-common.h b/src/os/shared/inc/os-shared-common.h index c6cb302fc..3de1a93ce 100644 --- a/src/os/shared/inc/os-shared-common.h +++ b/src/os/shared/inc/os-shared-common.h @@ -149,7 +149,7 @@ void OS_ApplicationShutdown_Impl(void); ------------------------------------------------------------------*/ static inline size_t OS_strnlen(const char *s, size_t maxlen) { - const char *end = memchr(s, 0, maxlen); + const char *end = (const char *)memchr(s, 0, maxlen); if (end != NULL) { /* actual length of string is difference */