|
有这样一个static的struct
static struct {
UINT16 SvcFlag:1;
UINT16 EmcOnly:1;
UINT16 MsOutOfDomain:1;
UINT16 RegisteredFlag:1;
UINT16 RegStatus:4;
UINT16 Active:1;
UINT16 SdStatus:1;
UINT16 Pad:6;
} Status;
还有这样一些的定义:
#define REG_STATUS reg_status
BYTE reg_status;
#define reg_status (global_variable_base->reg_status)
然后在执行到这样的code时候,出错了
if (Status.RegStatus!= REG_STATUS)
如果把上面的code改为这样,就不会出错
BYTE temp;
temp=REG_STATUS;
if (Status.RegStatus != temp)
环境是linux+GCC
难道global_variable_base这个结构的对齐问题?
请教各位大侠,这是为什么? |
|