Skip to content

Commit

Permalink
Fixed ‘ctx.codepoint’ may be used uninitialized.
Browse files Browse the repository at this point in the history
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);
  • Loading branch information
xeioex committed Jun 29, 2024
1 parent 1c2c7af commit 8c7ade4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/njs_utf8.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ njs_utf8_decode_init(njs_unicode_decode_t *ctx)
{
ctx->need = 0x00;
ctx->lower = 0x00;
ctx->codepoint = 0;
}


Expand Down

0 comments on commit 8c7ade4

Please sign in to comment.