Hello all,
In one of my projects (ATMega128 based) I am using floating point numbers and sprintf to write a formatted record to a buffer. Tthe buffer contents is then sent to a mini printer. The first two records print properly and thereafter I am getting garbage from sprintf!! The optimisation was set to 0. When I change the optimisation to s, then correct data is being printed!! Moreover there is a difference in the way _delay_loop_2 and _delay_loop_1 delays are generated with different optimisations. I would like to know the reason why this is happening (specially with sprintf) to avoid any pitfalls in my coding. Thanks in advance.

Nayani P


Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!
_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to