[Bug middle-end/92718] [8/9/10 Regression] Bogus Wstringop-overflow in __builtin_memset() of an element of array of size 1 of struct
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 2 16:11:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92718
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
Modifying const members of a struct is undefined, regardless of how it's done:
either by assignment or by overwriting it using memset. GCC doesn't diagnose
it yet but I expect it will, maybe as early as in GCC 11, similarly to how G++
diagnoses it.
More information about the Gcc-bugs
mailing list