Skip to content

Floating point comparison warning #802

@DarkWingMcQuack

Description

@DarkWingMcQuack

When building with gcc-12 and the -Wfloat-equal flag the following warning is raised:

/home/x/project/build/deps/cli11/include/CLI/TypeTools.hpp: In function ‘std::string CLI::detail::sum_string_vector(const std::vector<std::__cxx11::basic_string<char> >&)’:
/home/x/project/build/deps/cli11/include/CLI/TypeTools.hpp:1549:16: warning: comparing floating-point with ‘==’ or ‘!=’ is unsafe [-Wfloat-equal]
 1549 |            val == static_cast<std::int64_t>(val)) {
      |            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions