Permalink
Browse files

Fix warnings from g++5 or higher (#1510)

  • Loading branch information...
1 parent 0627213 commit df38f251be3d8df1e18a3990d7fb454df9d8b506 @tqchen tqchen committed on GitHub Aug 26, 2016
Showing with 9 additions and 6 deletions.
  1. +1 −1 dmlc-core
  2. +2 −1 include/xgboost/gbm.h
  3. +2 −1 include/xgboost/objective.h
  4. +2 −1 include/xgboost/tree_updater.h
  5. +1 −1 rabit
  6. +1 −1 src/c_api/c_api.cc
@@ -161,7 +161,8 @@ struct GradientBoosterReg
* \endcode
*/
#define XGBOOST_REGISTER_GBM(UniqueId, Name) \
- static ::xgboost::GradientBoosterReg & __make_ ## GradientBoosterReg ## _ ## UniqueId ## __ = \
+ static DMLC_ATTRIBUTE_UNUSED ::xgboost::GradientBoosterReg & \
+ __make_ ## GradientBoosterReg ## _ ## UniqueId ## __ = \
::dmlc::Registry< ::xgboost::GradientBoosterReg>::Get()->__REGISTER__(Name)
} // namespace xgboost
@@ -105,7 +105,8 @@ struct ObjFunctionReg
* \endcode
*/
#define XGBOOST_REGISTER_OBJECTIVE(UniqueId, Name) \
- static ::xgboost::ObjFunctionReg & __make_ ## ObjFunctionReg ## _ ## UniqueId ## __ = \
+ static DMLC_ATTRIBUTE_UNUSED ::xgboost::ObjFunctionReg & \
+ __make_ ## ObjFunctionReg ## _ ## UniqueId ## __ = \
::dmlc::Registry< ::xgboost::ObjFunctionReg>::Get()->__REGISTER__(Name)
} // namespace xgboost
#endif // XGBOOST_OBJECTIVE_H_
@@ -82,7 +82,8 @@ struct TreeUpdaterReg
* \endcode
*/
#define XGBOOST_REGISTER_TREE_UPDATER(UniqueId, Name) \
- static ::xgboost::TreeUpdaterReg& __make_ ## TreeUpdaterReg ## _ ## UniqueId ## __ = \
+ static DMLC_ATTRIBUTE_UNUSED ::xgboost::TreeUpdaterReg& \
+ __make_ ## TreeUpdaterReg ## _ ## UniqueId ## __ = \
::dmlc::Registry< ::xgboost::TreeUpdaterReg>::Get()->__REGISTER__(Name)
} // namespace xgboost
View
@@ -736,4 +736,4 @@ XGB_DLL int XGBoosterSaveRabitCheckpoint(BoosterHandle handle) {
}
// force link rabit
-static int XGBOOST_LINK_RABIT_C_API_ = RabitLinkTag();
+static DMLC_ATTRIBUTE_UNUSED int XGBOOST_LINK_RABIT_C_API_ = RabitLinkTag();

0 comments on commit df38f25

Please sign in to comment.