]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/rebuild_mondb: kill compiling warning
authorxie xingguo <xie.xingguo@zte.com.cn>
Sun, 18 Sep 2016 03:40:56 +0000 (11:40 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 18 Oct 2016 02:49:43 +0000 (10:49 +0800)
As follow:

[ 72%] Building CXX object src/tools/CMakeFiles/ceph-objectstore-tool.dir/RadosDump.cc.o
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rebuild_mondb.cc: In function ‘int update_mon_db(ObjectStore&, OSDSuperblock&, const string&, const string&)’:
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rebuild_mondb.cc:289:22: warning: ‘crc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         if (have_crc && osdmap.get_crc() != crc) {
                      ^
/home/jenkins-build/build/workspace/ceph-pull-requests/src/tools/rebuild_mondb.cc:238:14: note: ‘crc’ was declared here
     uint32_t crc;

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit f16a31476a3f9b44a7c3dabf0dfd2a0d015b11b9)

src/tools/rebuild_mondb.cc

index a8d36ec0f02ded3b1ced83d853faae2fa4aae2cf..81dceeb0755c9b4c6d88e5c0f441d3ecf4d1c404 100644 (file)
@@ -235,7 +235,7 @@ int update_osdmap(ObjectStore& fs, OSDSuperblock& sb, MonitorDBStore& ms)
   for (auto e = max(last_committed+1, sb.oldest_map);
        e <= sb.newest_map; e++) {
     bool have_crc = false;
-    uint32_t crc;
+    uint32_t crc = -1;
     uint64_t features = 0;
     // add inc maps
     {