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:
> [email protected]
> g
> [mailto:avr-gcc-list-bounces+knut.schwichtenberg=siemens....@n
ongnu.org] On Behalf Of larry barello
> Sent: Thursday, January 22, 2009 12:42 AM
> To: 'Vincent Trouilliez'; [email protected]
> 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 mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list