This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: scanf doesn't work


On Fri, Jun 19, 2009 at 6:33 AM, Leonitis<rubixqb@gmail.com> wrote:
>
> Thanks everyone for responding so fast!
>
> My toolchain setup is the standard arm-unknown-linux-gnu configuration:
> kernel headers version 2.6.29
> binutils version 2.19.1
> gcc 4.3.2
> glibc 2.9
> etc..
>
> My test code is:
> #include <stdio.h>
> #include <stdlib.h>
>
> int main(int argc, char** argv)
> {
> Â Â Â Âfloat a;
> Â Â Â Âint b;
>
> Â Â Â Âprintf("Input float: ");
> Â Â Â Âscanf("%f", &a);
> Â Â Â Âprintf("Input is: %f\n", a);
>
> Â Â Â Âprintf("\nInput integer: ");
> Â Â Â Âscanf("%d", &b);
> Â Â Â Âprintf("Input is: %d\n", b);
>
> Â Â Â Âreturn 0;
> }
>
> My output is:
> Input float: -3.5
> Input is: 3.500000
>
> Input integer: -3
> Input is: -3
>
> I'm not too familiar with what the Linux headers are for, but the kernel
> version on the evaluation board is 2.6.20. Could that be the problem?

I dont suspect kernel versions to be a problem here.
Could you try compile/run it as a static binary? if you have not done so.
It could just be a misatch of libraries on your system Vs the libraries
you are using to develop/compile the testcase

Thanks

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]