DAVE 4.3.2 does not generate any code for the sscanf function

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User13960
Level 3
Level 3
First like received
Hi all,

I am calling the sscanf function in my code but DAVE 4.3.2 ignores the %X specifier for interpreting Upper Case Hexadecimal input characters.

PHAB
0 Likes
5 Replies
User13960
Level 3
Level 3
First like received
OK, to answer my own question...

DAVE 4 does not interpret the upper case specifier "%X" but it does interpret the lower case specifier "%x" for both lower case AND upper case input.

Here are some examples...


unsigned int Data;

// The following are OK, they return a Data value of 15
sscanf( "0xf", "%x", &Data );
sscanf( "0xF","%x", &Data );
sscanf( "F", "%x", &Data );
sscanf( "f", "%x", &Data );

// The following are NOT OK, the Data value does not change
sscanf( "0xF", "%X", &Data );
sscanf( "0xf", "%X", &Data );
sscanf( "F", "%X", &Data );
sscanf( "f", "%X", &Data );

This seems like a bug in the library.

PHAB
0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Did you try using the Newlib library instead of the default Newlib-nano?
4516.attach

Regards,
Jesus
0 Likes
User13960
Level 3
Level 3
First like received
Hi Jesus, thanks very much for your reply.

I am using the 'Newlib-nano' library and have not tried the 'Newlib'.

Can you explain the difference between the libraries and the possible implications to other areas of my code, memory size, execution speed etc ?
0 Likes
User13960
Level 3
Level 3
First like received
Thanks again Jesus, I'll dig a bit deeper. It is very risky for me to change the library at a very late stage in the project.

Cheers
PHAB
0 Likes