-3
下面的代碼給了我一個缺失大括號的GCC錯誤,但無論我嘗試使用哪種組合(包括只有一個值爲0),它都不能解析。任何人都可以提供一些見解C結構數組初始化
#define NUM_TABLE_ELEMENTS 1
typedef struct parameter_t
{
struct
{
uint8_t A : 1;
uint8_t B : 1;
uint8_t C : 1;
uint8_t D : 5;
} W;
uint8_t X;
uint8_t Y;
uint8_t Z;
} parameter_t;
parameter_t MyTable[NUM_TABLE_ELEMENTS] =
{
{ { 1, 1, 1, 0 }, 0, 0, 0 },
};
這個編譯良好與C99標準設置([demo](http://ideone.com/0vuMlp))。 – dasblinkenlight
請發佈確切的錯誤消息和gcc標誌。 – 2501
錯誤:在初始化程序周圍缺少大括號[-Werror =丟失大括號] 我意識到這是一個升級警告...我是肛門保持性。 – SeaNick