diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-09-21 11:50:34 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-09-21 11:50:34 +0200 |
commit | 0f071848a107f82b57a2f15b4617c83c91291312 (patch) | |
tree | 37037e4a80f84d9fcf5d0d3d1b1fbc3867b297d3 | |
parent | Merge pull request #2324 (diff) | |
parent | Fixes static_assert on arm and ppc builds (diff) | |
download | monero-0f071848a107f82b57a2f15b4617c83c91291312.tar.xz |
Merge pull request #2479
58908295 Fixes static_assert on arm and ppc builds (Lee Clagett)
-rw-r--r-- | src/serialization/json_object.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/serialization/json_object.cpp b/src/serialization/json_object.cpp index ead3fdd58..e35389f9c 100644 --- a/src/serialization/json_object.cpp +++ b/src/serialization/json_object.cpp @@ -29,6 +29,7 @@ #include "json_object.h" #include <limits> +#include <type_traits> #include "string_tools.h" namespace cryptonote @@ -52,8 +53,9 @@ namespace void convert_numeric(Source source, Type& i) { static_assert( + (std::is_same<Type, char>() && std::is_same<Source, int>()) || std::numeric_limits<Source>::is_signed == std::numeric_limits<Type>::is_signed, - "source and destination signs do not match" + "comparisons below may have undefined behavior" ); if (source < std::numeric_limits<Type>::min()) { |