]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: always initialize local variable 29757/head
authorKefu Chai <kchai@redhat.com>
Tue, 20 Aug 2019 08:15:17 +0000 (16:15 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 20 Aug 2019 08:39:47 +0000 (16:39 +0800)
to silence a GCC warning like:

../src/osd/OSD.cc:4608:24: warning: ‘sender_delta_ub’ may be used
uninitialized in this function [-Wmaybe-uninitialized]
 4608 |       ceph::signedspan sender_delta_ub;
      |                        ^~~~~~~~~~~~~~~

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/OSD.cc

index 5d53df9b34863765d9075b2e807e20fec0039f27..b99b670cfad121b594619ae7cd02db7b9649bc68 100644 (file)
@@ -4605,7 +4605,7 @@ void OSD::handle_osd_ping(MOSDPing *m)
        }
       }
 
-      ceph::signedspan sender_delta_ub;
+      ceph::signedspan sender_delta_ub{};
       s->stamps->got_ping(
        m->up_from,
        mnow,