Warning with gcc 8.1 [-Wclass-memaccess] #1246
Comments
|
Duplicate of #1205 |
pah
added a commit
to pah/rapidjson-upstream
that referenced
this issue
Jul 15, 2018
Recent GCC versions warn about using memcpy/memmove to write to a class pointer (-Wclass-memaccess). Avoid the warnings by casting to void* first. Closes Tencent#1086. Closes Tencent#1205. Closes Tencent#1246.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
g++ 8.1.0 (on CentOS 6.9), RapidJSON v1.1.0
rapidjson/document.h:1989:24: warning:‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
std::memcpy(e, values, count * sizeof(GenericValue));
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rapidjson/document.h:548:7: ‘class rapidjson::GenericValue<rapidjson::UTF8<> >’ declared here
class GenericValue {
The text was updated successfully, but these errors were encountered: