Компилятор выдает ошибку: Error[Pe1049]: initializer cannot be specified for a flexible array member .
Использую IAR v.4.12A .
typedef struct menu_entry_s { unsigned char flags; // see flag definitions above void (*select)(void *arg, char *name); // routine to call when selected char name[MENU_ENTRY_NAMELEN]; // name to display for this entry void *value; // value to pass to select function } menu_entry_t;
/* Information on a specific menu. Previous is for the menu that this is a submenu of, or NULL if this is the main menu */
typedef struct menu_s { unsigned char top_entry; // top displayed entry unsigned char current_entry; // currently highlighted entry unsigned char num_entries; // total # of entries in menu struct menu_s *previous; // previous menu (for backtracking) menu_entry_t entry[]; } menu_t; ................................................................................ ...........................
menu_t sub1_menu = { .top_entry = 0, .current_entry = 0, > .entry = { //!!!!!Error[Pe1049]: initializer cannot be specified for a flexible array member . {.flags = 0, .select = my_select, .name = "s2", .value = 0, }, {.flags = 0, .select = my_select, .name = "s3", .value = 0, }, {.flags = 0, .select = my_select, .name = "s4", .value = 0, }, }, .num_entries = 3, .previous = NULL, };
Что я делаю не так?
|