我已经在union初始化中读取了struct,但它没有解决我的问题
在我的遗留代码中,我有大量的struct-with-union
typedef struct st
{
union
{
struct
{
uint8 sign ;
uint8 cells;
}s;
int data;
}u;
int extra;
} st;
Run Code Online (Sandbox Code Playgroud)
在C下,编译如下:
static const st someval = {
.sign = 0, .cells ={ 0 },
.cells = { 11 }
};
Run Code Online (Sandbox Code Playgroud)
有没有办法最小化更改编译方法(或代码),使其在g ++下编译?