From 8c7ade4228f8ae317348e15b8129b8b2f6a167c5 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Fri, 21 Jun 2024 17:58:32 -0700 Subject: [PATCH] =?UTF-8?q?Fixed=20=E2=80=98ctx.codepoint=E2=80=99=20may?= =?UTF-8?q?=20be=20used=20uninitialized.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building by GCC 13 with -O3 and -flto flags the following warning was reported: In function ‘njs_utf8_decode’, inlined from ‘njs_text_encoder_encode_into’ at src/njs_encoding.c:214:14: src/njs_utf8.c:191:42: error: ‘ctx.codepoint’ may be used uninitialized [-Werror=maybe-uninitialized] 191 | ctx->codepoint = (ctx->codepoint << 6) | (c & 0x3F); --- src/njs_utf8.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/njs_utf8.h b/src/njs_utf8.h index ce4d86657..5f2f81e27 100644 --- a/src/njs_utf8.h +++ b/src/njs_utf8.h @@ -128,6 +128,7 @@ njs_utf8_decode_init(njs_unicode_decode_t *ctx) { ctx->need = 0x00; ctx->lower = 0x00; + ctx->codepoint = 0; }