On Sat, 24 Jan 2009 17:46:35 -0700 "Weddington, Eric" <ewedding...@cso.atmel.com> wrote:
> Which means that you have the NULL and the &menu_sub *reversed* according to > your data structure layout, and then on top of this your &menu_sub is the > *wrong data*! The structure is looking for a pointer to a function, and you > are giving it a pointer to another struct TMenu type. Oops, I guess I must have confused you somehow (my fault) but I don't see how my pointers are reversed ? Or maybe my code is unclear. If they were reversed my program would not work anyhow, as it would try to call a function (dumy_fnc) instead of displaying a submenu, and vice-versa, calling a sub menu (menu_sub) when supposed to call the dummy_fnc() function. > The other two lines that I changed, were these: > > FncPtr = (void (*)(void))(pgm_read_word( & (p->items[0].fptr) )); > SubPtr = (const struct TMenu *)(pgm_read_word( & (p->items[0].ptr) )); Yeah I noticed these were your changes... I did try to put the cast as it was suggested to me (and by the GCC warning itseld), but unsurprinsingly I got it wrong, thanks for the help on this ! -- Vince _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list