I have a cpp file in which there's a call to sscanf(). The format specifier for the argument is %x, the argument itself is of type std::size_t*.
.
According to http://en.cppreference.com/w/cpp/io/c/fscanf, std::size_t* is a perfectly acceptable argument type for %x, but cppcheck complains:
%x in format string (no. 1) requires 'unsigned int ' but the argument type is 'std::size_t * {aka unsigned long long }'.
Last edit: antred 2016-09-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a cpp file in which there's a call to sscanf(). The format specifier for the argument is %x, the argument itself is of type
std::size_t*
..
According to http://en.cppreference.com/w/cpp/io/c/fscanf,
std::size_t*
is a perfectly acceptable argument type for %x, but cppcheck complains:Last edit: antred 2016-09-22
Hello!
Sorry for late reply.
Yes. But as I read it you need the 'z' length modifier.
I am not sure but I think something like:
does that work?