https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95140
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[10/11 Regression] bogus |[10/11 Regression] bogus
|-Wstringop-overflow for a |-Wstringop-overflow for a
|loop unrolled past the end |loop unrolled past the end
|of a trailing array |of an array
--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
The problem isn't specific to trailing arrays; it can be reproduced with an
interior member as well:
$ gcc -O3 -S -Wall pr95140.cpr95140.c: In function ‘f’:
pr95140.c:9:13: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
9 | p->v[i] = s[i];
| ~~~~~~~~^~~~~~
pr95140.c:3:8: note: at offset 8 into destination object ‘v’ of size 8
3 | char v[8], u;
| ^
...
pr95140.c:9:13: warning: writing 1 byte into a region of size 0
[-Wstringop-overflow=]
9 | p->v[i] = s[i];
| ~~~~~~~~^~~~~~
pr95140.c:3:8: note: at offset 14 into destination object ‘v’ of size 8
3 | char v[8], u;
| ^