From: Brad Hubbard Date: Tue, 24 Oct 2017 00:55:46 +0000 (+1000) Subject: cls_rbd: Silence gcc7 maybe-uninitialized warning X-Git-Tag: v13.0.1~331^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=772880f63c2eebc7e6302f3bb56d235f587367fa;p=ceph-ci.git cls_rbd: Silence gcc7 maybe-uninitialized warning gcc7 warns that GroupSnapshotNamespace::group_pool may be used uninitialized in SnapshotNamespaceOnDisk::decode. Reordering the member variables silences the spurious warning. Signed-off-by: Brad Hubbard --- diff --git a/src/cls/rbd/cls_rbd_types.h b/src/cls/rbd/cls_rbd_types.h index b82bf452e51..d0f73f14d33 100644 --- a/src/cls/rbd/cls_rbd_types.h +++ b/src/cls/rbd/cls_rbd_types.h @@ -252,13 +252,13 @@ struct GroupSnapshotNamespace { GroupSnapshotNamespace(int64_t _group_pool, const string &_group_id, - const snapid_t &_snapshot_id) :group_pool(_group_pool), - group_id(_group_id), - snapshot_id(_snapshot_id) {} + snapid_t _snapshot_id) + : group_id(_group_id), group_pool(_group_pool), snapshot_id(_snapshot_id) { + } + std::string group_id; int64_t group_pool = 0; - string group_id; - snapid_t snapshot_id; + snapid_t snapshot_id = CEPH_NOSNAP; void encode(bufferlist& bl) const; void decode(bufferlist::iterator& it);