]> git.kaiwu.me - njs.git/commit
Fixed build with gcc-15 and -O3.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 17 Sep 2025 01:28:05 +0000 (18:28 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Wed, 17 Sep 2025 18:55:10 +0000 (11:55 -0700)
commit6b12358be530b158375f97b9b45a90d593da15f9
tree2adc5ce19da3d5ca9da2a8e00dd1bf577e48689e
parent7b3c8a66879dc0d5250bfeb53b2fbc85d15da637
Fixed build with gcc-15 and -O3.

build/src/njs_object.dep -MT build/src/njs_object.o \ src/njs_object.c
In file included from src/njs_main.h:18, from src/njs_object.c:8: In
function ‘njs_utf8_copy’, inlined from ‘njs_object_enumerate_string’ at
src/njs_object.c:769:21: src/njs_utf8.h:115:20: error: writing 1 byte
into a region of size 0 [-Werror=stringop-overflow=] 115 |
*dst++ = c; |             ~~~~~~~^~~ src/njs_object.c: In function
‘njs_object_enumerate_string’: src/njs_object.c:719:24: note: at offset
4 into destination object ‘buf’ of size 4 719 |     u_char
buf[4], *c; |                        ^~~ In function ‘njs_utf8_copy’,
inlined from ‘njs_object_enumerate_string’ at src/njs_object.c:769:21:
src/njs_utf8.h:115:20: error: writing 1 byte into a region of size 0
[-Werror=stringop-overflow=]

GCC-15 does not know that the loop in njs_utf8_copy() is bounded
because the input is a valid UTF-8 here.

This fixes #967 issue on Github.
src/njs_array.c
src/njs_object.c