[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Improving in leaps and skips!

From: Björn Haase
Subject: Re: [avr-gcc-list] Improving in leaps and skips!
Date: Wed, 2 Mar 2005 23:09:35 +0100
User-agent: KMail/1.7.1

> The point is: nested functions *do work* in AVR-Ada for what they are
> typically used in Ada (limiting visibilty, enhancing code readability).
>      Rolf
IIRC nested functions are completely dysfunctional for avr when using C. The 
problem seems to be, that for any nested function gcc- c wants to generate a 
trampoline (self-modifying code stub on the stack-frame) which is not 
possible with read-only program memory.

If I understand correctly, the main use for nested functions is to locally 
define small functions that could access the local variables of the parent 
function and that could be passed, e.g. to library functions like quick-sort. 
E.g. for sorting arrays that reside on the stack frame of the parent 
I have seen a thread stating that this "passing pointers to nested functions 
to library routines" is a very popular coding style in ada.



reply via email to

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