"whether the field can overlap the connection of words is determined by the implementation.
Consider two words of memory, where the word size is 32 bits:
[31] [30] [29] ... [2] [1] [0] | [31] [30] [29] ... [2] [1] [0]
If we had a structure:
struct X
{
int a : 30;
int b : 4;
};
b, , , b :
[31] [30] [29] ... [2] [1] [0] | [31] [30] [29] [28] ... [2] [1] [0]
a
OR
a
GAP? , b, - , CPU.
; ( ) .
, :
struct X
{
int a : 30;
int : 2;
int b : 4;
};
: " 2 a b - (), , , ". 2 , 30 + 2 == 32 ( )... , , . , - , , , , - , , .
0 .
, , , . , , b , 2- (, 30 , 32), ...
struct X
{
int a : 30;
int : 0;
int b : 4;
};
... 2 . , a - 64- , , , .