[Top][All Lists]

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

Re: [avr-gcc-list] Converting string to uint32_t

From: Wim Lewis
Subject: Re: [avr-gcc-list] Converting string to uint32_t
Date: Tue, 14 Oct 2014 02:52:08 -0700
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 10/13/14 2:57 PM, Andreas Höschler wrote:
> void putLong_in_serial_trans_buffer(uint32_t value)
> {
>    char char_buffer[10];
>    utoa(value, char_buffer, 10); 

The truncation is probably happening here--- utoa() takes an unsigned
int, which is 16 bits on this architecture. Try using ultoa() instead
and see if that helps. Compiling with the -Wconversion option turned on
might warn about this kind of situation.


reply via email to

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