[Bug c/63944] [DR#413] Partial overriding of nonconstant struct/union initializers with designated initializers
ch3root at openwall dot com
gcc-bugzilla@gcc.gnu.org
Tue May 3 15:30:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63944
--- Comment #5 from Alexander Cherepanov <ch3root at openwall dot com> ---
Not sure this is relevant to static/automatic distinction mentioned above but
the following code uses a static struct, is accepted by gcc and exposes the
problem:
----------------------------------------------------------------------
#include <stdio.h>
static struct s {
struct sub {
int x, y;
} sub;
} s = (struct s){ (struct sub){1, 2}, .sub.y = 3 };
int main()
{
printf("%d %d\n", s.sub.x, s.sub.y);
}
----------------------------------------------------------------------
More information about the Gcc-bugs
mailing list