[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?
From: |
Schwichtenberg, Knut |
Subject: |
RE: [avr-gcc-list] Typdef chick 'n egg situation.. way out ? |
Date: |
Thu, 22 Jan 2009 08:40:36 +0100 |
Larry,
I'm not sure if I missed anything in the discussion.... I had the
problem in a linked list and my project compiled with avr-gcc 3.4.
flawlessly.
Here is my solution:
struct tmLokCmdTab;
typedef struct tmLokCmdTab{
struct tmLokCmdTab * ptrnext;
....
};
}t_mLokCmdTab;
I think the topic is called type forwarding and is at least identical to
function protoypes in headers.
Cheers
Knut
> -----Original Message-----
> From:
> address@hidden
> g
> [mailto:address@hidden
ongnu.org] On Behalf Of larry barello
> Sent: Thursday, January 22, 2009 12:42 AM
> To: 'Vincent Trouilliez'; address@hidden
> Subject: RE: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?
>
> 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.
>
> I have worked around this in several ways:
>
> 1. make the typedef array have a size of one.
> Allocate some memory to contain the array and assign a
> pointer of type to
> it.
> 2. Use a #define to create a unique typedef that maps to your
> basic type but
>
> declares the proper size array.
>
> Both schemes have issues. If there is a better way I would
> like to know
> about it.
> I presume C++ handles all this with grace, but I don't really know c++
>
> Finally, I bet there are better forums for this kind of
> discussion as this
> isn't very particular to avr-gcc!
>
- [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, Vincent Trouilliez, 2009/01/21
- RE: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, larry barello, 2009/01/21
- Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, Vincent Trouilliez, 2009/01/21
- Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, Dean Ferreyra, 2009/01/21
- Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, Vincent Trouilliez, 2009/01/21
- Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, Dean Ferreyra, 2009/01/21
- Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, Vincent Trouilliez, 2009/01/21
- RE: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, larry barello, 2009/01/21
- Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, Vincent Trouilliez, 2009/01/21
- Re: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?, Dave Hylands, 2009/01/21
- RE: [avr-gcc-list] Typdef chick 'n egg situation.. way out ?,
Schwichtenberg, Knut <=