From 33ad832d3a5d71978cc8607d3d12a38136d3bb73 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 28 Apr 2020 10:59:25 +0200 Subject: Fix GCC warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- app/perfattributes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/perfattributes.cpp') 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) -- cgit v1.2.3