範例

struct MyStruct {

unsigned char field:2;

};

解決方案
只利用 int 類型作為位元欄位。

struct MyStruct {

unsigned int field:2;
 

};