Fix #13006
closedcompile warning on gcc-4.8.3
0%
Description
There is a compiling warning:
os/Transaction.cc: In member function ‘void ObjectStore::Transaction::_build_actions_from_tbl()’:
os/Transaction.cc:287:33: warning: ‘void ObjectStore::Transaction::collection_move(coll_t, coll_t, const
ghobject_t&)’ is deprecated (declared at os/ObjectStore.h:1245) [-Wdeprecated-declarations]
collection_move(ncid, ocid, oid);
The warning message appeared because We use collection_move which has deprecated attribute.
So I want to know Whether we should take one of the following two methods:
1 add #pragma GCC diagnostic ignored "-Wdeprecated-declarations" in Transaction.cc, as the following patch:
--- a/src/os/Transaction.cc
+++ b/src/os/Transaction.cc -284,7 +284,10
void ObjectStore::Transaction::_build_actions_from_tbl()
assert(ocid2 ocid);
assert(oid2 oid);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
collection_move(ncid, ocid, oid);
+#pragma GCC diagnostic pop
2 just add some obvious code comments in ObjectStore.h, as the following patch:
--- a/src/os/ObjectStore.h
+ b/src/os/ObjectStore.h -1244,6 +1244,11
public:
}
data.ops;
}
/**
+ * Note: here we use deprecated attribute, so there will be a
+ * warning when compiling the code.
+ */
void collection_move(coll_t cid, coll_t oldcid, const ghobject_t& oid)