avr-chat
[Top][All Lists]
Advanced

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

AW: [avr-chat] re-entrant functions


From: Stumpf Michael
Subject: AW: [avr-chat] re-entrant functions
Date: Wed, 1 Feb 2006 08:05:08 +0100


:
:developer2112 (sent by Nabble.com) wrote:
:> Are re-entrant functions supported in winavr? If so, how does one go
:> about writing one? Is there some reentrant keyword that will
:cause the
:> compiler to use the stack for passing parameters instead of fixed
:> registers?
:
:Just because registers are used for parameter passing, doesn't make a
:function any less re-entrant. To be re-entrant, just don't
:store persistant
:state in the function such as with static variables.
:

It is compiler dependent.

I remember the Keil C51 compiler to generate non-reentrant code,
because lacal variables were stored in fixed memory locations
rather than on the stack. To make a function reentrant a special keyword
'reentrant' had to be applied to it.

But that was a very special case, no?
Winavr does generate reentrant code with no extra effort.

Recursive functions are only one kind of reentrant functions

regards, Michael



:_______________________________________________
:AVR-chat mailing list
:address@hidden
:http://lists.nongnu.org/mailman/listinfo/avr-chat
:


reply via email to

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