Building current version 1.14 (2c04d9675f194c4de4e5b6e32892557cb7d2471b) of petitboot in postmarketOS v23.12 / Alpine Linux 3.19, with ncurses 6.4_p20231125 and gcc 13.2.1_git20231014 fails with:
In file included from ui/ncurses/nc-cui.h:25,
from ui/ncurses/generic-main.c:41:
ui/ncurses/nc-menu.h: In function 'pmenu_dump_item':
ui/ncurses/nc-menu.h:129:47: error: invalid use of incomplete typedef 'ITEM' {aka 'const struct tagITEM'}
129 | pb_debug("%p %s\n", item, (item ? item->name.str : "(null)"));
| ^~
ui/ncurses/nc-menu.h: In function 'pmenu_dump_items':
ui/ncurses/nc-menu.h:138:45: error: invalid use of incomplete typedef 'ITEM' {aka 'struct tagITEM'}
138 | (items[i] ? items[i]->name.str : "(null)"));
| ^~
make[2]: *** [Makefile:5726: ui/ncurses/petitboot_nc-generic-main.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/pmos/build/src/petitboot-v1.13'
make[1]: *** [Makefile:5907: all-recursive] Error 1
make[1]: Leaving directory '/home/pmos/build/src/petitboot-v1.13'
make: *** [Makefile:2824: all] Error 2
Looking at ncurses menu.h:
typedef struct tagITEM
#if !NCURSES_OPAQUE_MENU
{
TEXT name; /* name of menu item */
TEXT description; /* description of item, optional in display */
struct tagMENU *imenu; /* Pointer to parent menu */
void *userptr; /* Pointer to user defined per item data */
Item_Options opt; /* Item options */
short index; /* Item number if connected to a menu */
short y; /* y and x location of item in menu */
short x;
bool value; /* Selection value */
struct tagITEM *left; /* neighbor items */
struct tagITEM *right;
struct tagITEM *up;
struct tagITEM *down;
}
#endif /* !NCURSES_OPAQUE_MENU */
ITEM;
So item_name() has to be used instead of item->name.str. Here is half a patch:
However then it fails in another place, where petitboot tries to write to items[i]->name.str. Apparently there is no setter function for it in ncurses and a new label would need to be created instead (?) - I didn't look into it in detail.
Building current version 1.14 (2c04d9675f194c4de4e5b6e32892557cb7d2471b) of petitboot in postmarketOS v23.12 / Alpine Linux 3.19, with ncurses 6.4_p20231125 and gcc 13.2.1_git20231014 fails with:
Looking at ncurses
menu.h
:So
item_name()
has to be used instead ofitem->name.str
. Here is half a patch:However then it fails in another place, where petitboot tries to write to items[i]->name.str. Apparently there is no setter function for it in ncurses and a new label would need to be created instead (?) - I didn't look into it in detail.