[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: David Brown
Subject: Re: [avr-gcc-list] calling function pointers via pointers ?
Date: Thu, 29 Sep 2005 09:34:28 +0200

"Joerg Wunsch" <address@hidden> wrote in message
> "stevech" <address@hidden> wrote:
> > Unspecified array sizes are a basic no-no on a microprocessor
> > platform. The compiler strategies have to be simple and explicit,
> > unlike elegant situations on multi-megabyte big computers.
> I disagree.  Vincent was going to put a table of initialized structs
> into ROM, and there's no penalty involved in the unspecified array
> size for that purpose.

I'd go further and say that unspecified array sizes are *exactly* what you
want for this sort of thing, when you have your structures and arrays
defined as constants in flash.  I've written a menuing system (on another
target) with an old commercial compiler that didn't support unconstrained
arrays, and I've written one using gcc (for the msp430, but the idea's the
same).  Without the unconstrained arrays, you either have to mess around
with all sorts of extra levels of indirection and define your lists of menu
entries seperately, or you have to specify the same size for all your menus,
thus wasting lots of space and causing extra work whenever you need to make
your biggest menu just that little bit bigger.



reply via email to

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