Adam Majer
f14dc08a28
Fix build with gcc-8 OBS-URL: https://build.opensuse.org/request/show/619749 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/rapidjson?expand=0&rev=4
37 lines
1.3 KiB
Diff
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);
|