Skip to content

Clang emits -Wfloat-equal warning in consumer projects #1096

@mxgrey

Description

@mxgrey

I'm using clang-6.0 on Ubuntu 16.04, and I've found that projects that consume dartsim version 6 will get hit by the -Wfloat-equal warning from GenericJoint.hpp if they try to instantiate any joint types.

The consumer projects can avoid this by adding the dartsim headers as SYSTEM headers, but if it's possible to do a bitwise comparison of floating point variables without triggering this warning, then it would be good to switch to that.

The only way I can think of doing that off the top of my header is something goofy like:

reinterpret_cast<long long&>(value) == reinterpret_cast<long long&>(Base::mAspectProperties.mField)

but I'd prefer to avoid solutions that involve reinterpret_cast or make assumptions about the sizes of primitive types.

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