cppcheck--enable=allsnippet.cppportability:%finformatstring(no.1)requires'double'buttheargumenttypeis'int {aka signed int}'.[invalidPrintfArgType_float]printf("%f\n",std::abs(f));
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
The following code snippet triggers "invalidPrintfArgType_float" even if the return type of std::abs here is float.
Overloads are not handled very well, and the return type is given as
int
instd.cfg
. See this ticket: https://trac.cppcheck.net/ticket/8084