=== begin test.c ===
struct foo {
int bar;
union {
int baz;
} ubaz;
};
struct foo my_fun1() {
struct foo res = {0, {}};
return res;
}
struct foo my_fun2() {
struct foo res = {0, {.baz = 0}};
return res;
}
=== end test.c ===
compiling this code causes an internal compiler error:
===
$ armcl -mv7M4 --c99 -I/opt/ti-cgt-arm_5.2.7/include -c --output_file test.o test.c
>> INTERNAL ERROR: ILLEGAL INITIALIZATION
This may be a serious problem. Please contact customer support with a
description of this problem and a sample of the source files that caused this
INTERNAL ERROR message to appear.
Note: May loose variable initialization information
... continuing compilation ...
===
if the foo member is removed, then the result is an outright crash ("INTERNAL ERROR: armcg experienced a segmentation fault").
the problem seems to be in the empty ubaz member initializer used in my_fun1.