From 9216b96b4117009c75214bcc8aca048d472d2d14 Mon Sep 17 00:00:00 2001 From: YoongHM Date: Mon, 21 Sep 2020 22:04:34 +0800 Subject: [PATCH] Fix compilation warning in jemalloc's malloc_vsnprintf (#7789) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change `val` to `unsigned char` before being tested. The fix is identical to the one that's been made in upstream jemalloc. warning is: src/malloc_io.c: In function ‘malloc_vsnprintf’: src/malloc_io.c:369:2: warning: case label value exceeds maximum value for type 369 | case '?' | 0x80: \ | ^~~~ src/malloc_io.c:581:5: note: in expansion of macro ‘GET_ARG_NUMERIC’ 581 | GET_ARG_NUMERIC(val, 'p'); | ^~~~~~~~~~~~~~~ --- deps/jemalloc/src/malloc_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/jemalloc/src/malloc_io.c b/deps/jemalloc/src/malloc_io.c index 7bdc13f95..dd8826511 100644 --- a/deps/jemalloc/src/malloc_io.c +++ b/deps/jemalloc/src/malloc_io.c @@ -362,7 +362,7 @@ malloc_vsnprintf(char *str, size_t size, const char *format, va_list ap) { } \ } while (0) #define GET_ARG_NUMERIC(val, len) do { \ - switch (len) { \ + switch ((unsigned char)len) { \ case '?': \ val = va_arg(ap, int); \ break; \