The header file inttypes.h provided by Segger Embedded Studios does not correctly define SCNu8. The macro SCNu8 should be the vscanf formatter to read an uint8_t type. According to multiple sources online it is properly defined as:
#define SCNu8 'hhu'
decimal scanf format for uint8_t
However in SES inttypes.h it is defined:
// %u
#define SCNu8 "u"
#define SCNu16 __RAL_SCN_16_PREFIX "u"
#define SCNu32 __RAL_SCN_32_PREFIX "u"
#define SCNu64 "llu"
This results in the static analysis tool generating an warning:
format specifies type 'unsigned int *' but the argument has type 'uint8_t *' (aka 'unsigned char *') [clang-diagnostic-format]
when the code has
uint8_t log_severity_lvl;
sscanf( argv[1], "%"SCNu8, &log_severity_lvl ) );
#define SCNu8 'hhu'
decimal scanf format for uint8_t
However in SES inttypes.h it is defined:
// %u
#define SCNu8 "u"
#define SCNu16 __RAL_SCN_16_PREFIX "u"
#define SCNu32 __RAL_SCN_32_PREFIX "u"
#define SCNu64 "llu"
This results in the static analysis tool generating an warning:
format specifies type 'unsigned int *' but the argument has type 'uint8_t *' (aka 'unsigned char *') [clang-diagnostic-format]
when the code has
uint8_t log_severity_lvl;
sscanf( argv[1], "%"SCNu8, &log_severity_lvl ) );