avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] A couple GCC warnings I would like tounderstand/get r


From: Weddington, Eric
Subject: RE: [avr-gcc-list] A couple GCC warnings I would like tounderstand/get rid of...
Date: Sat, 24 Jan 2009 18:47:40 -0700

 

> -----Original Message-----
> From: 
> address@hidden 
> [mailto:address@hidden
> org] On Behalf Of Vincent Trouilliez
> Sent: Saturday, January 24, 2009 6:12 PM
> To: address@hidden
> Subject: Re: [avr-gcc-list] A couple GCC warnings I would 
> like tounderstand/get rid of...
> 
> On Sat, 24 Jan 2009 17:46:35 -0700
> "Weddington, Eric" <address@hidden> 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. 
> 

Ah, ok, I see now. Sorry that I just gave it a quick glance.

Again, typecasts are all that you need. See attached; no warnings, no errors. 

Attachment: menu.c
Description: menu.c


reply via email to

[Prev in Thread] Current Thread [Next in Thread]