Closed rageworx closed 1 year ago
Code is
// create a menu with all children
overflow_menu = new Fl_Menu_Item[nc+1];
memset(overflow_menu, 0, sizeof(Fl_Menu_Item)*(nc+1));
for (i = 0; i < nc; i++) {
overflow_menu[i].label(child(i)->label());
overflow_menu[i].user_data(child(i));
overflow_menu[i].labelfont(labelfont());
overflow_menu[i].labelsize(labelsize());
if ( (i == fv) || (i == lv) )
overflow_menu[i].flags |= FL_MENU_DIVIDER;
if (child(i)->visible())
overflow_menu[i].labelfont_ |= FL_BOLD;
}
It looks g++ sense to memset() size as pointer, maybe cast to size_t may should fix this warning.
It should avoid size overflow warning by
overflow_menu = new Fl_Menu_Item[nc+1];
size_t overflow_menu_clrsz = sizeof(Fl_Menu_Item) * ((size_t)nc+1);
memset(overflow_menu, 0, overflow_menu_clrsz);
Or
// create a menu with all children
overflow_menu = new Fl_Menu_Item[nc+1];
memset(overflow_menu, 0, sizeof(Fl_Menu_Item) * ((size_t)nc+1));
Issue solved at commit of 314029d..1d5ebd8.
Code updated to using latest type :
overflow_menu = new Fl_Menu_Item[nc+1];
memset(overflow_menu, 0, sizeof(Fl_Menu_Item) * ((size_t)nc+1));
commit = 1d5ebd8..1657357