From: Dmitry Volyntsev Date: Sat, 22 Jun 2024 00:58:32 +0000 (-0700) Subject: Fixed ‘ctx.codepoint’ may be used uninitialized. X-Git-Tag: 0.8.6~47 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=8c7ade4228f8ae317348e15b8129b8b2f6a167c5;p=njs.git Fixed ‘ctx.codepoint’ may be used uninitialized. 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); --- diff --git a/src/njs_utf8.h b/src/njs_utf8.h index ce4d8665..5f2f81e2 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; }