[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] calling function pointers via pointers ?
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] calling function pointers via pointers ? |
Date: |
Wed, 28 Sep 2005 21:06:57 +0200 (MET DST) |
Vincent Trouilliez <address@hidden> wrote:
> What's the trick ?
None. You cannot have two arrays with unspecified size within the
same object. The compiler needs to be able to compute the offset of
each struct element at compile-time, and this offset needs to be the
same for each instantiated object of that type. That way, an array of
unspecified size (i.e. one where the actual memory consumption will
only be determined by the initializer) must be the last element of the
struct as this is the only option to have all struct members at an
identical offset.
You could store a table of strings completely outside the menu
structs, and only have a (still fixed-size) table of pointers to them
inside.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
- [avr-gcc-list] calling function pointers via pointers ?, Vincent Trouilliez, 2005/09/28
- Re: [avr-gcc-list] calling function pointers via pointers ?, Lars Noschinski, 2005/09/28
- Re: [avr-gcc-list] calling function pointers via pointers ?, Thomas Buchta, 2005/09/28
- Re: [avr-gcc-list] calling function pointers via pointers ?, Vincent Trouilliez, 2005/09/28
- Re: [avr-gcc-list] calling function pointers via pointers ?,
Joerg Wunsch <=
- RE: [avr-gcc-list] calling function pointers via pointers ?, stevech, 2005/09/29
- Re: [avr-gcc-list] calling function pointers via pointers ?, Joerg Wunsch, 2005/09/29
- RE: [avr-gcc-list] calling function pointers via pointers ?, Vincent Trouilliez, 2005/09/29
- RE: [avr-gcc-list] calling function pointers via pointers ?, Vincent Trouilliez, 2005/09/29
- Re: [avr-gcc-list] calling function pointers via pointers ?, David Brown, 2005/09/29
- Re: [avr-gcc-list] calling function pointers via pointers ?, Dave Hansen, 2005/09/28
- Re: [avr-gcc-list] calling function pointers via pointers ?, David Brown, 2005/09/29
- Re: [avr-gcc-list] calling function pointers via pointers ?, Vincent Trouilliez, 2005/09/29
- Re: [avr-gcc-list] calling function pointers via pointers ?, David Brown, 2005/09/29
- Re: [avr-gcc-list] calling function pointers via pointers ?, Vincent Trouilliez, 2005/09/29