From 091d16ab13beb3becc42cc40209048b6f0f8df9a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 19 Oct 2012 09:06:06 -0700 Subject: [PATCH] mds: init in cap_reconnect_t ctor At (2): Non-static class member field "capinfo.cap_id" is not initialized in this constructor nor in any functions that it calls. At (4): Non-static class member field "capinfo.wanted" is not initialized in this constructor nor in any functions that it calls. At (6): Non-static class member field "capinfo.issued" is not initialized in this constructor nor in any functions that it calls. At (8): Non-static class member field "capinfo.snaprealm" is not initialized in this constructor nor in any functions that it calls. At (10): Non-static class member field "capinfo.pathbase" is not initialized in this constructor nor in any functions that it calls. CID 717257 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) At (12): Non-static class member field "capinfo.flock_len" is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Sage Weil --- src/mds/mdstypes.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mds/mdstypes.h b/src/mds/mdstypes.h index 5a19022fc7d87..2e6fae54da425 100644 --- a/src/mds/mdstypes.h +++ b/src/mds/mdstypes.h @@ -810,7 +810,9 @@ struct cap_reconnect_t { mutable ceph_mds_cap_reconnect capinfo; bufferlist flockbl; - cap_reconnect_t() {} + cap_reconnect_t() { + memset(&capinfo, 0, sizeof(capinfo)); + } cap_reconnect_t(uint64_t cap_id, inodeno_t pino, const string& p, int w, int i, inodeno_t sr) : path(p) { capinfo.cap_id = cap_id; -- 2.39.5