Merge pull request #279 from pah/fix/pedantic

Fixes for GCC with -pedantic
This commit is contained in:
Milo Yip 2015-04-02 09:44:25 +08:00
commit f5b021d7cb
4 changed files with 6 additions and 3 deletions

View File

@ -54,7 +54,7 @@ struct MessageHandler
enum State { enum State {
kExpectObjectStart, kExpectObjectStart,
kExpectNameOrObjectEnd, kExpectNameOrObjectEnd,
kExpectValue, kExpectValue
}state_; }state_;
std::string name_; std::string name_;
}; };

View File

@ -30,6 +30,7 @@ RAPIDJSON_DIAG_OFF(4702) // unreachable code
#elif defined(__GNUC__) #elif defined(__GNUC__)
RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF(effc++) RAPIDJSON_DIAG_OFF(effc++)
RAPIDJSON_DIAG_OFF(overflow)
#endif #endif
RAPIDJSON_NAMESPACE_BEGIN RAPIDJSON_NAMESPACE_BEGIN

View File

@ -252,7 +252,8 @@ private:
(*outHigh)++; (*outHigh)++;
return low; return low;
#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) #elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__)
unsigned __int128 p = static_cast<unsigned __int128>(a) * static_cast<unsigned __int128>(b); __extension__ typedef unsigned __int128 uint128;
uint128 p = static_cast<uint128>(a) * static_cast<uint128>(b);
p += k; p += k;
*outHigh = p >> 64; *outHigh = p >> 64;
return static_cast<uint64_t>(p); return static_cast<uint64_t>(p);

View File

@ -75,7 +75,8 @@ struct DiyFp {
h++; h++;
return DiyFp(h, e + rhs.e + 64); return DiyFp(h, e + rhs.e + 64);
#elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) #elif (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__)
unsigned __int128 p = static_cast<unsigned __int128>(f) * static_cast<unsigned __int128>(rhs.f); __extension__ typedef unsigned __int128 uint128;
uint128 p = static_cast<uint128>(f) * static_cast<uint128>(rhs.f);
uint64_t h = p >> 64; uint64_t h = p >> 64;
uint64_t l = static_cast<uint64_t>(p); uint64_t l = static_cast<uint64_t>(p);
if (l & (uint64_t(1) << 63)) // rounding if (l & (uint64_t(1) << 63)) // rounding