From ad723636df0ef36e5a71e357a1269e0e542d4753 Mon Sep 17 00:00:00 2001 From: John McFarlane Date: Thu, 30 Jun 2016 00:56:45 -0700 Subject: [PATCH 1/6] fixes case in #include directive --- examples/example91.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/example91.cpp b/examples/example91.cpp index 3c7aa90..e432b05 100644 --- a/examples/example91.cpp +++ b/examples/example91.cpp @@ -47,7 +47,7 @@ using safe_bool_t = boost::numeric::safe_unsigned_range< >; #define DESKTOP -#include "motor1.c" +#include "Motor1.c" #include #include From 07b11f8ce9cac6b5410a2681f06f68d1ab198efc Mon Sep 17 00:00:00 2001 From: John McFarlane Date: Tue, 9 Aug 2016 08:25:51 -0700 Subject: [PATCH 2/6] add `-std=c++14` to to compiler flags - only tested with Clang 3.8 and GCC 5.4 --- examples/CMakeLists.txt | 1 + test/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index a3790b5..b387c43 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -24,6 +24,7 @@ foreach(file_name ${example_list}) add_executable(${base_name} ${file_name}) add_test(NAME ${base_name} COMMAND ${base_name}) set_target_properties(${base_name} PROPERTIES FOLDER "example") + target_compile_options(${base_name} PUBLIC "-std=c++14") endforeach(file_name) set_target_properties(example84 PROPERTIES diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f0a057d..a0f8592 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -23,6 +23,7 @@ foreach(file_name ${test_list}) add_executable(${base_name} ${file_name}) add_test(NAME ${base_name} COMMAND ${base_name}) set_target_properties(${base_name} PROPERTIES FOLDER "tests") + target_compile_options(${base_name} PUBLIC "-std=c++14") endforeach(file_name) # end test targets From 019c2e90adf651114319a872e33b254c914cee85 Mon Sep 17 00:00:00 2001 From: John McFarlane Date: Tue, 9 Aug 2016 08:40:07 -0700 Subject: [PATCH 3/6] fixes compiler warning --- include/exception_policies.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/exception_policies.hpp b/include/exception_policies.hpp index fdde825..0f5a0f7 100644 --- a/include/exception_policies.hpp +++ b/include/exception_policies.hpp @@ -25,12 +25,12 @@ namespace numeric { // this would emulate the normal C/C++ behavior of permitting overflows // and the like. struct ignore_exception { - static void no_error(const char * message) {} - static void uninitialized_error(const char * message) {} - static void overflow_error(const char * message) {} - static void underflow_error(const char * message) {} - static void range_error(const char * message) {} - static void domain_error(const char * message) {} + static void no_error(const char *) {} + static void uninitialized_error(const char *) {} + static void overflow_error(const char *) {} + static void underflow_error(const char *) {} + static void range_error(const char *) {} + static void domain_error(const char *) {} }; // example - if you want to specify specific behavior for particular exception @@ -70,7 +70,7 @@ struct no_exception_support { // If an exceptional condition is detected at runtime throw the exception. // map our exception list to the ones in stdexcept struct throw_exception { - static void no_error(const char * message) { + static void no_error(const char *) { } static void unintialized_error(const char * message) { throw std::invalid_argument(message); From c77b1c73c014d2488ac3e4beeef2c8d22f034e32 Mon Sep 17 00:00:00 2001 From: John McFarlane Date: Tue, 9 Aug 2016 08:47:50 -0700 Subject: [PATCH 4/6] fixes operator precedence error --- include/interval.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/interval.hpp b/include/interval.hpp index 6dc356c..172a851 100644 --- a/include/interval.hpp +++ b/include/interval.hpp @@ -402,7 +402,7 @@ constexpr bool operator!=( const interval & t, const interval & u ){ - return ! t == u; + return ! (t == u); } template From 4dd06dc8669e39d38954547d379b47b247782519 Mon Sep 17 00:00:00 2001 From: John McFarlane Date: Tue, 9 Aug 2016 08:48:10 -0700 Subject: [PATCH 5/6] removes unused aliases --- include/safe_base_operations.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/safe_base_operations.hpp b/include/safe_base_operations.hpp index c786573..1abf232 100644 --- a/include/safe_base_operations.hpp +++ b/include/safe_base_operations.hpp @@ -1301,7 +1301,6 @@ typename boost::lazy_enable_if_c< constexpr inline operator|(const T & t, const U & u){ using bwr = bitwise_or_result; using result_base_type = typename bwr::result_base_type; - using exception_policy = typename bwr::exception_policy; const checked_result r = checked::bitwise_or( @@ -1370,7 +1369,6 @@ typename boost::lazy_enable_if_c< constexpr inline operator&(const T & t, const U & u){ using bwr = bitwise_and_result; using result_base_type = typename bwr::result_base_type; - using exception_policy = typename bwr::exception_policy; const checked_result r = checked::bitwise_and( @@ -1407,7 +1405,6 @@ typename boost::lazy_enable_if_c< constexpr inline operator^(const T & t, const U & u){ using bwr = bitwise_or_result; using result_base_type = typename bwr::result_base_type; - using exception_policy = typename bwr::exception_policy; const checked_result r = checked::bitwise_xor(t, u); From 0230b9695df78cbd489c01398b53d04dbd02765a Mon Sep 17 00:00:00 2001 From: John McFarlane Date: Tue, 9 Aug 2016 23:54:32 -0700 Subject: [PATCH 6/6] changes std::numeric_limits from class to struct - avoids irksome Clang warning, 'mismatched-tags' --- include/safe_base.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/safe_base.hpp b/include/safe_base.hpp index da5ed26..87fe939 100644 --- a/include/safe_base.hpp +++ b/include/safe_base.hpp @@ -165,7 +165,7 @@ class safe_base { > friend class safe_base; - friend class std::numeric_limits< + friend struct std::numeric_limits< safe_base >; @@ -280,7 +280,7 @@ template< class P, class E > -class numeric_limits > +struct numeric_limits > : public std::numeric_limits { using SB = boost::numeric::safe_base;