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.



_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to