Solved
SCNu8 formatting
Hi,
I was expecting to get x = 23 after following code:
uint8_t x ;
char* y = "23" ;
sscanf ( y , SCNu8 , &x ) ;but I got x = 32.

Hi,
I was expecting to get x = 23 after following code:
uint8_t x ;
char* y = "23" ;
sscanf ( y , SCNu8 , &x ) ;but I got x = 32.

From comment in inttypes.h:
NOTICE: scanning 8-bit types requires use of the hh specifier
* which is only supported on newlib platforms that
* are built with C99 I/O format support enabled. If the flag in
* newlib.h hasn't been set during configuration to indicate this, the 8-bit
* scanning format macros are disabled here as they result in undefined
* behaviour which can include memory overwrite.Build config of newlib is in ... tools/arm-none-eabi/include/newlib-nano/newlib.h and there _WANT_IO_C99_FORMATS is not enabled. Hope this answers your question, see also here.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.