Topic : sscanf calls scanf?

Forum : ARM

Original Post
Post Information Post
December 16, 2009 - 8:15am
Guest

I'm trying to use sscanf() to parse strings, but the sscanf() functions seems to call scanf() function.
The STM is a STM32F101RC and I have selected small printf and I have added STM32F10X_IO_putchar to my code.
(I have deselected UART0 putchar) and don't use precompiled librarys (I have added all stm32f10x.x that is needed
into my project library).

When i call the sscanf() function it starts to expect input from keyboard instead of parsing the string supplied as parameter.
As far as I can see other seems to have been using sscanf() succesfully?

I'm using other function such as atoi, mktime and many other libc functions and they work as expected.

I have not tried to compile any of the e_stdio.a or the other library myself, just using the one supplied with Ride.
Ride version 7.24.09.251 and STM 3.1.2 library.

Best regards,

Per

Replies
Post Information Post
+1
0
-1
December 17, 2009 - 3:27pm
Guest

Hi

It look like a bug in our putchar and small printf library.
This bug can appear depending on the order in which the macro defines are handled.
Some defines are done from the source and some are in the compiler.
And depending on the first define reached the result can be different.

Please first check the result of defining or undefining _REENT_ONLY in the code line just before your sscanf call.
If this does not change the behaviour try to send to support your project it will be easier to find which define is wrong.

Regards
Matloub