From: amitkuma Date: Fri, 4 Aug 2017 14:37:30 +0000 (+0530) Subject: messages: Initializing uninitialized members MMonPaxos X-Git-Tag: v12.1.3~87^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16814%2Fhead;p=ceph.git messages: Initializing uninitialized members MMonPaxos Fixes coverity Issue: 2. uninit_member: Non-static class member epoch is not initialized in this constructor nor in any functions that it calls. 4. uninit_member: Non-static class member op is not initialized in this constructor nor in any functions that it calls. 6. uninit_member: Non-static class member first_committed is not initialized in this constructor nor in any functions that it calls. 8. uninit_member: Non-static class member last_committed is not initialized in this constructor nor in any functions that it calls. 10. uninit_member: Non-static class member pn_from is not initialized in this constructor nor in any functions that it calls. 12. uninit_member: Non-static class member pn is not initialized in this constructor nor in any functions that it calls. 14. uninit_member: Non-static class member uncommitted_pn is not initialized in this constructor nor in any functions that it calls. CID 717298 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) 16. uninit_member: Non-static class member latest_version is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Amit Kumar amitkuma@redhat.com --- diff --git a/src/messages/MMonPaxos.h b/src/messages/MMonPaxos.h index 4b21ee38a0ba..8a5e4f934161 100644 --- a/src/messages/MMonPaxos.h +++ b/src/messages/MMonPaxos.h @@ -47,18 +47,18 @@ class MMonPaxos : public Message { } } - epoch_t epoch; // monitor epoch - __s32 op; // paxos op - - version_t first_committed; // i've committed to - version_t last_committed; // i've committed to - version_t pn_from; // i promise to accept after - version_t pn; // with with proposal - version_t uncommitted_pn; // previous pn, if we are a LAST with an uncommitted value + epoch_t epoch = 0; // monitor epoch + __s32 op = 0; // paxos op + + version_t first_committed = 0; // i've committed to + version_t last_committed = 0; // i've committed to + version_t pn_from = 0; // i promise to accept after + version_t pn = 0; // with with proposal + version_t uncommitted_pn = 0; // previous pn, if we are a LAST with an uncommitted value utime_t lease_timestamp; utime_t sent_timestamp; - version_t latest_version; + version_t latest_version = 0; bufferlist latest_value; map values;