Re: [arm-gnu] sprintf issue on Cortex-M3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [arm-gnu] sprintf issue on Cortex-M3
- To: Norbert Unterberg <nunterberg@xxxxxxxxx>
- Subject: Re: [arm-gnu] sprintf issue on Cortex-M3
- From: Daniel Jacobowitz <dan@xxxxxxxxxxxxxxxx>
- Date: Tue, 15 Dec 2009 09:17:15 -0500
On Tue, Dec 15, 2009 at 02:06:07PM +0100, Norbert Unterberg wrote:
> Hi,
>
> we are using arm-none-eabi-gcc (Sourcery G++ Lite 2009q3-68) 4.4.1.
>
> Formatting a floating point number with sprintf does not seem to work:
>
> char b[20];
> float temperature = 0.4f;
> sprintf(b, "%6.1f ", temperature);
>
> prints " -0.0" into the buffer.
I tried this using Sourcery G++ 4.4-70, using a Luminary LM3S811
board. It worked fine, printing " 0.4 " into the buffer. The problem
must be specific to your linker scripts or startup code; it's not in
the library.
--
Daniel Jacobowitz
CodeSourcery