https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83781
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org --- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> --- I can reproduce the problem with the following test case. Let me take care of it. $ cat z.c && gcc -O2 -S -Wall z.c const char* const a[32] = { "1", "12", "123" }; char d[4]; void f (int i) { __builtin_sprintf (d, "%s", a[i]); } z.c: In function āfā: z.c:7:26: warning: ā%sā directive writing up to 255 bytes into a region of size 4 [-Wformat-overflow=] __builtin_sprintf (d, "%s", a[i]); ^~