Using cppcheck 2.18.0 to check this code:
struct ST { unsigned char a[1]; }; void f(){ ST st; sscanf("1", "%hhu", st.a); }
got this warning:
test.cpp:6:5: warning: %hhu in format string (no. 1) requires 'unsigned char *' but the argument type is 'const char *'. [invalidScanfArgType_int] sscanf("1", "%hhu", st.a); ^
Is this a false positive warning?
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14302
Thank you for confirming.
Log in to post a comment.
Using cppcheck 2.18.0 to check this code:
got this warning:
Is this a false positive warning?
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/14302
Thank you for confirming.