From 772880f63c2eebc7e6302f3bb56d235f587367fa Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Tue, 24 Oct 2017 10:55:46 +1000 Subject: [PATCH] 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 --- src/cls/rbd/cls_rbd_types.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); -- 2.39.5