You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using double/float inside structures it's generating bad comparison (operator==) code which triggers gcc warnings
namespace Test
struct A
{
0: required double fieldA;1: required float fieldB;
};
Run as following:
#:/tmp$ gbc c++ -o ./ ./test.idl
#:/tmp$ g++ -Wfloat-equal -c ./test_types.cpp
In file included from ./test_reflection.h:16,
from ./test_types.cpp:14:
./test_types.h: In member function 'bool Test::A::operator==(const Test::A&) const':
./test_types.h:59:37: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
&& (fieldA == other.fieldA)
^~~~~~
./test_types.h:60:37: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
&& (fieldB == other.fieldB);
^~~~~~
The text was updated successfully, but these errors were encountered:
Bond builds with -Wall. -Wfloat-equal is not in -Wall.
Please build Bond-generated code with -Wall and without -Wfloat-equal. Consider using -isystem to add the generated Bond code to you header search path so that warnings in your code that uses Bond. This should let you continue to use -Wfloat-eqaul in your own code.
The Bond project itself isn't interested in being 100% warning clean for every warning that every compiler can emit. So, we at Microsoft have no plans to change the generated code to handle -Wfloat-equal.
When using double/float inside structures it's generating bad comparison (operator==) code which triggers gcc warnings
Run as following:
The text was updated successfully, but these errors were encountered: