summaryrefslogtreecommitdiff
path: root/layout/base
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-08-18 15:10:01 -0500
committertrav90 <travawine@palemoon.org>2018-08-18 15:10:01 -0500
commit26f02a2001f65d7808d17e6f2ded4944187ebe32 (patch)
tree998ac88d2b541f8380332d42c998bb559d4d90ec /layout/base
parentf36ad080c6f2f13012180dc0ac566893be9020ad (diff)
downloaduxp-26f02a2001f65d7808d17e6f2ded4944187ebe32.tar.gz
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.
Diffstat (limited to 'layout/base')
-rw-r--r--layout/base/nsArenaMemoryStats.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/layout/base/nsArenaMemoryStats.h b/layout/base/nsArenaMemoryStats.h
index ba09baaa42..2a872cfe83 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)
{