Q
Quentin Pope
On my compiler, the output of "sizeof(foo)" of the following is 8,
instead of 4.
Which indicates that the compiler is aligning the union at
the next int boundary, rather than coalescing it with "proto".
I think this is a bug.
struct s_skip_ind {
unsigned skip_ind:4;
};
struct s_trans_id {
unsigned trans_val:3;
unsigned trans_id:1;
};
struct foo {
unsigned proto:4;
union {
s_skip_ind skip_ind;
s_trans_id trans_id;
};
};
instead of 4.
Which indicates that the compiler is aligning the union at
the next int boundary, rather than coalescing it with "proto".
I think this is a bug.
struct s_skip_ind {
unsigned skip_ind:4;
};
struct s_trans_id {
unsigned trans_val:3;
unsigned trans_id:1;
};
struct foo {
unsigned proto:4;
union {
s_skip_ind skip_ind;
s_trans_id trans_id;
};
};