Fix warnings on GCC 6 and later (closes #666)

* document.h
  * suppress -Wterminate on GCC 6.x and later
  * simplify warning handling
* schema.h
  * drop RAPIDJSON_NOEXCEPT from GenericSchemaDocument constructor
    (calls RAPIDJSON_NEW anyway)
  * simplify warning handling
    (avoids RAPIDJSON_POP mismatch on Clang)
* encodingtest.cpp, istreamwrappertest.cpp
  * work around -Wdangling-else
* readertest.cpp
  * suppress -Wdangling-else
This commit is contained in:
Philipp A. Hartmann
2016-06-23 21:42:16 +02:00
parent 1c087b77cb
commit f6a07692f9
5 changed files with 18 additions and 46 deletions

View File

@@ -23,15 +23,17 @@
using namespace rapidjson;
#ifdef __GNUC__
RAPIDJSON_DIAG_PUSH
#ifdef __GNUC__
RAPIDJSON_DIAG_OFF(effc++)
RAPIDJSON_DIAG_OFF(float-equal)
RAPIDJSON_DIAG_OFF(missing-noreturn)
#if __GNUC__ >= 6
RAPIDJSON_DIAG_OFF(dangling-else)
#endif
#endif // __GNUC__
#ifdef __clang__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF(variadic-macros)
RAPIDJSON_DIAG_OFF(c++98-compat-pedantic)
#endif
@@ -1839,10 +1841,4 @@ TEST(Reader, ParseNanAndInfinity) {
#undef TEST_NAN_INF
}
#ifdef __GNUC__
RAPIDJSON_DIAG_POP
#endif
#ifdef __clang__
RAPIDJSON_DIAG_POP
#endif