diff options
author | trav90 <travawine@palemoon.org> | 2018-08-18 15:10:01 -0500 |
---|---|---|
committer | trav90 <travawine@palemoon.org> | 2018-08-18 15:10:01 -0500 |
commit | 26f02a2001f65d7808d17e6f2ded4944187ebe32 (patch) | |
tree | 998ac88d2b541f8380332d42c998bb559d4d90ec /layout/base | |
parent | f36ad080c6f2f13012180dc0ac566893be9020ad (diff) | |
download | UXP-26f02a2001f65d7808d17e6f2ded4944187ebe32.tar UXP-26f02a2001f65d7808d17e6f2ded4944187ebe32.tar.gz UXP-26f02a2001f65d7808d17e6f2ded4944187ebe32.tar.lz UXP-26f02a2001f65d7808d17e6f2ded4944187ebe32.tar.xz UXP-26f02a2001f65d7808d17e6f2ded4944187ebe32.zip |
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.h | 7 |
1 files changed, 6 insertions, 1 deletions
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) { |