-Wstringop-overflow warning from gcc-14
sezero opened this issue · comments
As inlined below
In file included from /SDL_image/src/IMG_stb.c:58:
/SDL_image/src/stb_image.h: In function 'stbi__parse_png_file.constprop':
/SDL_image/src/stb_image.h:5323:56: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
5323 | for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/SDL_image/src/stb_image.h:5230:25: note: at offset 3 into destination object 'tc' of size 3
5230 | stbi_uc has_trans=0, tc[3]={0};
| ^~
Others have reported the issue to mainstream already: nothings/stb#1642
Should we close this as WONTFIX?