rapidjson/ignore_gcc8_warnings.patch

37 lines
1.3 KiB
Diff

commit 54dab1eebb0dea32d9ea49dad4fa9c98816c21ed
Author: Romain Geissler <romain.geissler@amadeus.com>
Date: Mon Feb 19 12:52:16 2018 +0100
Ignore GCC 8 warnings.
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
index eb6d7dcb..69ac924b 100644
--- a/include/rapidjson/document.h
+++ b/include/rapidjson/document.h
@@ -2014,7 +2014,12 @@ private:
if (count) {
GenericValue* e = static_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue)));
SetElementsPointer(e);
+RAPIDJSON_DIAG_PUSH
+#if defined(__GNUC__) && __GNUC__ >= 8
+RAPIDJSON_DIAG_OFF(class-memaccess) // ignore complains from gcc that no trivial copy constructor exists.
+#endif
std::memcpy(e, values, count * sizeof(GenericValue));
+RAPIDJSON_DIAG_POP
}
else
SetElementsPointer(0);
@@ -2027,7 +2032,12 @@ private:
if (count) {
Member* m = static_cast<Member*>(allocator.Malloc(count * sizeof(Member)));
SetMembersPointer(m);
+RAPIDJSON_DIAG_PUSH
+#if defined(__GNUC__) && __GNUC__ >= 8
+RAPIDJSON_DIAG_OFF(class-memaccess) // ignore complains from gcc that no trivial copy constructor exists.
+#endif
std::memcpy(m, members, count * sizeof(Member));
+RAPIDJSON_DIAG_POP
}
else
SetMembersPointer(0);