diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 4bc2a1d5..6a8cb954 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -44,8 +44,19 @@ message(STATUS "Boost Python Library: ${Boost_PYTHON_LIBRARY}") # disable Boost auto-linking add_definitions (-DBOOST_ALL_NO_LIB) -cxx_add_compile_options(Clang -fPIC -Wall -Werror) -cxx_add_compile_options(GNU -fPIC -Wall -Werror) +cxx_add_compile_options(Clang + -fPIC + -Wall + -Werror + -Wno-unknown-warning-option + -Wno-unused-local-typedefs) + +cxx_add_compile_options(GNU + -fPIC + -Wall + -Werror + -Wno-unknown-warning-option + -Wno-unused-local-typedefs) include_directories ( ${BOND_INCLUDE} diff --git a/cpp/test/compat/compare.h b/cpp/test/compat/compare.h index e7161234..99bf5c99 100644 --- a/cpp/test/compat/compare.h +++ b/cpp/test/compat/compare.h @@ -6,15 +6,15 @@ class Compare; inline bool Equal(double left, double right) { // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm - int64_t l = *(int*)&left; + int64_t l = *(int64_t*)&left; if (l < 0) l = 0x8000000000000000LL - l; - int64_t r = *(int*)&right; + int64_t r = *(int64_t*)&right; if (r < 0) r = 0x8000000000000000LL - r; - return abs(l - r) < 5; + return (l - r) < 5 && (l - r) > -5; } diff --git a/cpp/test/core/equal.h b/cpp/test/core/equal.h index ea49c907..4fc6f753 100644 --- a/cpp/test/core/equal.h +++ b/cpp/test/core/equal.h @@ -42,15 +42,15 @@ private: inline bool Equal(double left, double right) { // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm - int64_t l = *(int*)&left; + int64_t l = *(int64_t*)&left; if (l < 0) l = 0x8000000000000000LL - l; - int64_t r = *(int*)&right; + int64_t r = *(int64_t*)&right; if (r < 0) r = 0x8000000000000000LL - r; - return abs(l - r) < 5; + return (l - r) < 5 && (l - r) > -5; }