https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85484
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2019-11-08 Assignee|unassigned at gcc dot gnu.org |msebor at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- My WIP patch for pr91582 detects both of these bugs: pr85484.c: In function ‘g’: pr85484.c:7:3: warning: ‘__builtin_strcpy’ writing one too many bytes into a region of a size that depends on ‘strlen’ [-Wstringop-overflow=] 7 | __builtin_strcpy (d, s); // missing -Wstringop-overflow | ^~~~~~~~~~~~~~~~~~~~~~~ pr85484.c:6:13: note: at offset 0 to an object with size at most 4294967295 allocated by ‘__builtin_alloca’ here 6 | char *d = __builtin_alloca (n); // off-by-one error (should be n + 1) | ^~~~~~~~~~~~~~~~~~~~ pr85484.c: In function ‘h’: pr85484.c:15:3: warning: ‘__builtin_strcpy’ writing one too many bytes into a region of a size that depends on ‘strlen’ [-Wstringop-overflow=] 15 | __builtin___strcpy_chk (d, s, __builtin_object_size (d, 1)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pr85484.c:14:13: note: at offset 0 to an object with size at most 4294967295 allocated by ‘__builtin_alloca’ here 14 | char *d = __builtin_alloca (n); | ^~~~~~~~~~~~~~~~~~~~