From 26f02a2001f65d7808d17e6f2ded4944187ebe32 Mon Sep 17 00:00:00 2001 From: trav90 Date: Sat, 18 Aug 2018 15:10:01 -0500 Subject: Avoid using memset on a not-trivial type like nsTabSizes nsTabSizes is non-trivial only because of the user-defined constructor. The idea desired here is certainly to zero all the members without listing them -- but the very act of doing so with a user-defined constructor, makes the idea impossible. Arguably this is something that is permissible in the language, and that the warning should be tailored to permit. I don't think this falls afoul of any of the issues flagged in https://gcc.gnu.org/ml/gcc-patches/2017-06/msg01527.html for example. In the meantime, just explicitly zeroing the three member fields is easy and fixes the warnings. --- layout/base/nsArenaMemoryStats.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'layout/base/nsArenaMemoryStats.h') diff --git a/layout/base/nsArenaMemoryStats.h b/layout/base/nsArenaMemoryStats.h index ba09baaa4..2a872cfe8 100644 --- a/layout/base/nsArenaMemoryStats.h +++ b/layout/base/nsArenaMemoryStats.h @@ -18,7 +18,12 @@ public: Other // Everything else. }; - nsTabSizes() { mozilla::PodZero(this); } + nsTabSizes() + : mDom(0) + , mStyle(0) + , mOther(0) + { + } void add(Kind kind, size_t n) { -- cgit v1.2.3