[Buildroot] C double type problem - at91sam9263

Christopher Taylor chtaylo3 at gmail.com
Tue Aug 5 16:37:43 UTC 2008


Could this be related to how you are compiling the code, uclibc, and
the OS as far as endian-ness ?  big vs middle vs little endian?

just a thought.  I've been burned by the middle-endianness on the
arm9261.  Last I looked there were some defects in how buildroot took
your parameters and implemented them in uClibc and the kernel (I seem
to remeber there was a bug in uClibc that buildroot incorrectly worked
around, but I wouldn't swear to it)

-Chris

On Tue, Aug 5, 2008 at 6:51 AM, Richard Hardy
<richardh at oakleafconsultancy.com> wrote:
>
>
>> -----Original Message-----
>> From: Ulf Samuelsson [mailto:ulf.samuelsson at atmel.com]
>> Sent: 05 August 2008 12:21
>> To: Richard Hardy; buildroot at uclibc.org
>> Subject: Re: [Buildroot] C double type problem - at91sam9263
>>
>> ----- Original Message -----
>>
>>       From: Richard Hardy <mailto:richardh at oakleafconsultancy.com>
>>       To: buildroot at uclibc.org
>>       Sent: Monday, August 04, 2008 12:29 PM
>>       Subject: [Buildroot] C double type problem - at91sam9263
>>
>>
>>
>>       Hi Everyone,
>>
>>       I am quite new to using buildroot and embedded linux systems in
>> general. However, I have managed to use buildroot to get a (nearly)
>> working system up and running for an at91sam9263 board. (kernel v
> 2.6.22,
>> uClibc v 0.9.29)
>>
>>
>>
>>       I have one annoying problem though. One of the packages I am
>> compiling from source uses C's "double" type, and this does not seem
> to be
>> behaving as I need it to.
>>
>>
>>
>>       I have created a simple example program:
>>
>>
>>
>>       ...
>>
>>       int main (int argc, char *argv[])
>>
>>       {
>>
>>       double test;
>>
>>       test = 1;
>>
>>       fprintf(stderr, "Test double = %f.\n", test);
>>
>>       }
>>
>>
>>
>>
>>
>> Should you not be using "%lf" instead of "%f" ?
>>
>>    fprintf(stderr, "Test double = %lf.\n", test);
>>
>>    fprintf(stderr, "Test double = %f.\n", test);
>>
>> Best Regards
>> Ulf Samuelsson
>>
>
> Yes, you are right. But, it makes no difference to the output.
>
> Best regards,
> Richard.
>
> _______________________________________________
> buildroot mailing list
> buildroot at uclibc.org
> http://busybox.net/mailman/listinfo/buildroot
>



More information about the buildroot mailing list