[Top][All Lists]

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

Re: [avr-libc-dev] Re: snprintf bug ?

From: Marek Michalkiewicz
Subject: Re: [avr-libc-dev] Re: snprintf bug ?
Date: Fri, 14 Oct 2005 19:47:37 +0200
User-agent: Mutt/1.5.9i

On Fri, Oct 14, 2005 at 07:27:52PM +0200, Björn Haase wrote:
> Background is, that when changing the prologue for "main" the way Marek has 
> suggested a couple of weeks ago, 'main' would become a normal function. Marek 
> suggested to use the attribute 'naked' in order to avoid the unnecessary 
> safes/restores. For cases like this one, however, we then would be having 
> problems.

Actually, what I suggested was a little different: a new function
attribute which means "this function doesn't need to save/restore
any registers" (but still use frame pointer and reserve stack space
for local variables if necessary - that's how it differs from "naked").

IAR C code examples in Atmel app notes declare main() with __C_task
which probably does this.

Alternatively, if main() runs an infinite loop (which is the case in
most typical AVR applications), "noreturn" attribute can be used -
it has the same effect (avoid saving registers), and works now.

Hope this helps,

reply via email to

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