openweave / openweave-core

openWeave is a home area network application protocol stack designed to enable asynchronous, symmetric, device-to-device, device-to-mobile and device-to-cloud communications for control path and data path messaging.
Apache License 2.0
233 stars 105 forks source link

Fix class-memaccess warning from GCC 9 #680

Closed aaronokano closed 3 years ago

aaronokano commented 3 years ago

GCC's class-memaccess warning reports cases where functions like memset, memcpy, etc. are used on non-trivial types. This change replaces a memset(this, 0, sizeof(*this)) in the DataElementDataContext struct with explicit zero-initialization of each member, since DataElementDataContext is a non-trivial type (member mTraitPath has a user-defined default constructor).