KEIL, MDK on C99 structure variable initialization

Reference to C99: here

For example, declare a struct like this

typedef struct{
    u16 cursorx;
    u16 cursory;
    u16 x1,y1;
    u16 x2,y2;
    u16 point_color;
    u16 back_color;
    u8 size;
    u8 mode;
} _tft_printtypedef;

and declare variables, initialize

_tft_printtypedef TFT_prStuc={.cursorx= 0 ,
                .cursory=0,
                .x1=0,
                .y1=0,
                .point_color=WHITE,
                .back_color=BLUE,
                .size=12,
                .mode=0};

 

Such initialization will not prompt after writing in keil (the keil5 I use), but the compilation will error

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325947647&siteId=291194637