gcc-2.95 vs gcc-3.x
?????, ?? ?????????? ? ??? ????? ???? ?????????
???? 2 ???????????? ???????????:
gcc-2.95
gcc-3.4
---?? ????????---
niko@niko:gcc-bug$ gcc-3.4 init-test.c
init-test.c:23: error: initializer element is not constant
init-test.c:23: error: (near initialization for `union_table[0]')
---??? ??? OK---
niko@niko:gcc-bug$ gcc-2.95 init-test.c
---???---
niko@niko:gcc-bug$ cat init-test.c
struct _struct1 {
int i;
int j;
};
struct _struct2 {
int a;
int b;
};
union _union1 {
struct _struct1 struct1;
struct _struct2 struct2;
};
static union _union1 union_table[] = {
(union _union1)
(struct _struct1)
{
i: 1,
j: 2,
},
};
int main(void)
{
return 0;
}
Reply to: