From a20e758ab8733ee043d39ec572e8a2ecd94cb7d8 Mon Sep 17 00:00:00 2001 From: Vladimir Khomutov Date: Wed, 28 Dec 2022 15:16:33 +0300 Subject: [PATCH] Core: fixed format specifier in ngx_realloc(). The uintptr_t is an integer type, so the solution is to either update format specifier or cast the value to pointer. Attempt to cast results in compiler warning as described in comment regarding gcc 12 workaround. --- src/os/unix/ngx_alloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/os/unix/ngx_alloc.c b/src/os/unix/ngx_alloc.c index 474c001ca..0b3af9e9e 100644 --- a/src/os/unix/ngx_alloc.c +++ b/src/os/unix/ngx_alloc.c @@ -62,10 +62,10 @@ ngx_realloc(void *p, size_t size, ngx_log_t *log) rp = realloc(p, size); if (rp == NULL) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, - "realloc(%p, %uz) failed", ptr, size); + "realloc(%0uXi, %uz) failed", ptr, size); } - ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0, "realloc: %p:%uz (prev: %p)", + ngx_log_debug3(NGX_LOG_DEBUG_ALLOC, log, 0, "realloc: %p:%uz (prev: %0uXi)", rp, size, ptr); return rp;