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.