avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] [bug #20092] AVR-GCC code size increase from 3.4.6 to


From: Dmitry K.
Subject: Re: [avr-libc-dev] [bug #20092] AVR-GCC code size increase from 3.4.6 to 4.1.2
Date: Mon, 29 Oct 2007 19:42:42 +1000
User-agent: KMail/1.5

On Wednesday 24 October 2007 00:44, Joerg Wunsch wrote:
[...]
> As for the compiler changes itself, the only thing I'm immediately
> aware of is that main() is now treated as a normal function,
> so it gets prologue/epilogue code.  This can be avoided by
> declaring it `naked' first:
>
> int main(void) __attribute__((naked));
> int
> main(void) {
>   ...
> }
>
> (A more appropriate attribute is in the works, this will
> be the equivalent of other compilers' __C_task keyword.)

Doubtful advice.
The 'naked' attribute cancels obligatory manipulations
on mapping in a stack of local variables. And in case of
compilation without optimization (by default) it is
necessary even for one variable.

I would suggest to not use a 'make main() as a normal
fuction' patch if is not present absolutely necessity.
The 'return' operator from main() function is admissible
and without this patch and really returns value.

Dmitry.





reply via email to

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