Commit 4cb7c88c authored by Milo Yip's avatar Milo Yip

Try to fix clang and gcc warnings problems again x3

parent a6a73b51
...@@ -164,12 +164,12 @@ TEST(Reader, ParseNumber_Integer) { ...@@ -164,12 +164,12 @@ TEST(Reader, ParseNumber_Integer) {
u.u |= r(); u.u |= r();
char buffer[32]; char buffer[32];
if (u.u > 4294967295) { if (u.u > uint64_t(4294967295u)) {
*internal::u64toa(u.u, buffer) = '\0'; *internal::u64toa(u.u, buffer) = '\0';
TEST_INTEGER(ParseUint64Handler, buffer, u.u); TEST_INTEGER(ParseUint64Handler, buffer, u.u);
} }
if (u.i < -2147483648) { if (u.i < -int64_t(2147483648u)) {
*internal::i64toa(u.i, buffer) = '\0'; *internal::i64toa(u.i, buffer) = '\0';
TEST_INTEGER(ParseInt64Handler, buffer, u.i); TEST_INTEGER(ParseInt64Handler, buffer, u.i);
} }
......
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
#include "rapidjson/internal/strtod.h" #include "rapidjson/internal/strtod.h"
#ifdef __clang__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF(unreachable-code)
#endif
#define BIGINTEGER_LITERAL(s) BigInteger(s, sizeof(s) - 1) #define BIGINTEGER_LITERAL(s) BigInteger(s, sizeof(s) - 1)
using namespace rapidjson::internal; using namespace rapidjson::internal;
...@@ -121,3 +126,7 @@ TEST(Strtod, CheckApproximationCase) { ...@@ -121,3 +126,7 @@ TEST(Strtod, CheckApproximationCase) {
EXPECT_EQ(-1, delta.Compare(hS)); EXPECT_EQ(-1, delta.Compare(hS));
} }
#ifdef __clang__
RAPIDJSON_DIAG_POP
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment