For the following code
struct abc_struct {
unsigned a:2;
unsigned b:2;
unsigned c:12;
};
unsigned bar(struct abc_struct s)
{
return s.c;
}
unsigned foo(void)
{
return bar((struct abc_struct) {2, 2, 42});
}
I get the error messages (with cgtools 5.2.10 and 6.0.2):
"con_init.c", line 1531: error #120: cast to type "struct abc_struct" is not
allowed
return bar((struct abc_struct) {2, 2, 42});
^
"con_init.c", line 1531: error #29: expected an expression
return bar((struct abc_struct) {2, 2, 42});
^
Is this behaviour to be expected?
Thanks, Johannes