我有一个代码,它使用如下声明的位字段
typedef struct my{
const char *name;
uint8_t is_alpha : 1;
uint8_t is_hwaccel : 1;
uint8_t x_chroma_shift;
uint8_t y_chroma_shift;
} mystr;
Run Code Online (Sandbox Code Playgroud)
uint8_t是typedef'ed unsigned char.
使用此位字段在MS-VS 2008中构建代码会发出如下警告:
imgconvert.c(60) : warning C4214: nonstandard extension used : bit-field types other than int.