struct one {
int a;
int values[]; } x = {5, {1, 2, 3}};
struct one x2 = { 5, 1, 2, 3 };
void test(void) {
struct one x3 = {5, {1, 2, 3}}; struct one x3a = { 5 };
struct one x3b = { .a = 5 };
struct one x3c = { 5, {} }; }
struct foo {
int x;
int y[]; };
struct bar { struct foo z; };
struct foo a = { 1, { 2, 3, 4 } }; struct bar b = { { 1, { 2, 3, 4 } } }; struct bar c = { { 1, { } } }; struct foo d[1] = { { 1, { 2, 3, 4 } } };
struct foo desig_foo = { .y = {2, 3, 4} }; struct bar desig_bar = { .z.y = { } }; struct bar desig_bar2 = { .z.y = { 2, 3, 4} }; struct foo design_foo2 = { .y = 2 };
struct point {
int x, y;
};
struct polygon {
int numpoints;
struct point points[]; };
struct polygon poly = {
.points[2] = { 1, 2} };
struct X {
int a;
int b;
char data[];
};
struct Y {
int a:4;
int b:4;
int c;
int d;
int e;
struct X xs[]; };
struct PR8217a {
int i;
char v[]; };
void PR8217(void) {
struct PR8217a foo1 = { .i = 0, .v = "foo" }; struct PR8217a foo2 = { .i = 0 };
struct PR8217a foo3 = { .i = 0, .v = { 'b', 'a', 'r', '\0' } }; struct PR8217a bar;
}
typedef struct PR10648 {
unsigned long n;
int v[]; } PR10648;
int f10648(void) {
return (PR10648){2, {3, 4}}.v[1]; }
struct FlexWithUnnamedBitfield { int : 10; int x; int y[]; }; void TestFlexWithUnnamedBitfield(void) {
struct FlexWithUnnamedBitfield x = {10, {3}}; }