RE: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?

2009-01-21 Thread larry barello
Use a struct tag, rather than the typdef tag for your storage type, as: typedef struct _TMenu { ... struct _TMenuItem items[]; } TMenu; typedef struct _TMenuItem { ... struct _TMenu *ptr; ... } MenuItem; -Original Message- Subject: [avr-gcc-list]

Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?

2009-01-21 Thread Vincent Trouilliez
On Wed, 21 Jan 2009 09:14:39 -0700 larry barello la...@barello.net wrote: Use a struct tag, rather than the typdef tag for your storage type, as: Thanks Larry. -- Vince ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org

Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?

2009-01-21 Thread Dean Ferreyra
larry barello wrote: Use a struct tag, rather than the typdef tag for your storage type, as: typedef struct _TMenu { ... struct _TMenuItem items[]; } TMenu; typedef struct _TMenuItem { ... struct _TMenu *ptr; ... } MenuItem; BTW, avr-gcc complains

Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?

2009-01-21 Thread Vincent Trouilliez
On Wed, 21 Jan 2009 09:33:43 -0800 Dean Ferreyra dferre...@igc.org wrote: Also, Vince, do you really mean to use a flexible array for the items field; i.e., leaving the size of items unspecified? Yes.. well it's just out of convenience really. When I define/initialise a structure of that type,

Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?

2009-01-21 Thread Dean Ferreyra
Vincent Trouilliez wrote: On Wed, 21 Jan 2009 09:33:43 -0800 Dean Ferreyra dferre...@igc.org wrote: Also, Vince, do you really mean to use a flexible array for the items field; i.e., leaving the size of items unspecified? Yes.. well it's just out of convenience really. When I

Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?

2009-01-21 Thread Vincent Trouilliez
On Wed, 21 Jan 2009 10:14:03 -0800 Dean Ferreyra dferre...@igc.org wrote: Vincent Trouilliez wrote: On Wed, 21 Jan 2009 09:33:43 -0800 Dean Ferreyra dferre...@igc.org wrote: Also, Vince, do you really mean to use a flexible array for the items field; i.e., leaving the size of items

Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?

2009-01-21 Thread Vincent Trouilliez
On Wed, 21 Jan 2009 16:41:37 -0700 larry barello la...@barello.net wrote: You can't make a flexible typdef. If you did that the compiler would Ops yes, might be, don't know because to solve my problem I have been suggested to not use Typedef. Dunnon why I wanted to make a Type ouf of my

Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?

2009-01-21 Thread Dave Hylands
Hi guys, On Wed, Jan 21, 2009 at 3:41 PM, larry barello la...@barello.net wrote: You can't make a flexible typdef. If you did that the compiler would have multiple definitions for various instances of the typedef and get horribly confused. Actually, with gcc you can. gcc supports the notion