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
commit15eea35fd67523c1304129176f4674b4558455a1 (patch)
tree998ac88d2b541f8380332d42c998bb559d4d90ec /layout/base
parent5f35ad49b9e0057b774b4e82546244fc8564bc2b (diff)
downloaduxp-15eea35fd67523c1304129176f4674b4558455a1.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)
{