summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2020-04-28 10:59:25 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2020-04-28 10:04:39 +0000
commit33ad832d3a5d71978cc8607d3d12a38136d3bb73 (patch)
tree8aade662b8092381688d096e5ad4fc5dd9910b23
parentf0ad7794a4d03827262ca0a3a952e7e0ccd47cf0 (diff)
Fix GCC warning
app/perfattributes.cpp:28: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class PerfEventAttributes’; use assignment or value-initialization instead [-Wclass-memaccess] 28 | memset(this, 0, sizeof(PerfEventAttributes)); | ^ Change-Id: I1970aaa3e17073bdabfdb4d1805d7e64dc64c464 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--app/perfattributes.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/perfattributes.cpp b/app/perfattributes.cpp
index 3493d6b..d13f9ac 100644
--- a/app/perfattributes.cpp
+++ b/app/perfattributes.cpp
@@ -25,7 +25,7 @@
PerfEventAttributes::PerfEventAttributes()
{
- memset(this, 0, sizeof(PerfEventAttributes));
+ *this = PerfEventAttributes{};
}
QDataStream &operator>>(QDataStream &stream, PerfEventAttributes &attrs)