Skip to content

Fix cppcheck 1.5.1 warning #4755

Open
@nlohmann

Description

@nlohmann

In #4753, a new warning was raised by the new Cppcheck version:

include/nlohmann/detail/output/serializer.hpp:835:36: warning: %g in format string (no. 2) requires ‘double’ but the argument type is ‘number_float_t’. [invalidPrintfArgType_float]
        std::ptrdiff_t len = (std::snprintf)(number_buffer.data(), number_buffer.size(), “%.*g”, d, x);
                                   ^

We need to check whether to suppress or fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions