This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/63944] [DR#413] Partial overriding of nonconstant struct/union initializers with designated initializers
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Nov 2014 00:42:42 +0000
- Subject: [Bug c/63944] [DR#413] Partial overriding of nonconstant struct/union initializers with designated initializers
- Auto-submitted: auto-generated
- References: <bug-63944-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63944
--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
Actually, I suppose the existing approach for strings could be used if
desired - split the struct into a series of component references to a
SAVE_EXPR of the nonconstant struct initializer (in the case of a union,
the partially overriding initializer would say which union element needs
splitting like that). Whether that's desirable is another matter (say the
struct being partially overridden is struct S { int a[1000000]; } -
splitting into separate initializers would mean 1000000 SAVE_EXPRs, which
seems unlikely to work well).