From 3e8ff3e586aae8bd89ea0e272fabbea3bd836aa6 Mon Sep 17 00:00:00 2001 From: conrad Date: Wed, 22 Sep 2021 01:16:39 +1000 Subject: [PATCH] warn on unused result --- include/armadillo_bits/BaseCube_bones.hpp | 2 +- include/armadillo_bits/BaseCube_meat.hpp | 3 ++- include/armadillo_bits/SpBase_bones.hpp | 2 +- include/armadillo_bits/SpBase_meat.hpp | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/armadillo_bits/BaseCube_bones.hpp b/include/armadillo_bits/BaseCube_bones.hpp index cb6e23ea..3c96e048 100644 --- a/include/armadillo_bits/BaseCube_bones.hpp +++ b/include/armadillo_bits/BaseCube_bones.hpp @@ -31,7 +31,7 @@ struct BaseCube_eval_Cube template struct BaseCube_eval_expr { - arma_inline Cube eval() const; //!< force the immediate evaluation of a delayed expression + inline arma_warn_unused Cube eval() const; //!< force the immediate evaluation of a delayed expression }; diff --git a/include/armadillo_bits/BaseCube_meat.hpp b/include/armadillo_bits/BaseCube_meat.hpp index 89974a6b..ac90d99d 100644 --- a/include/armadillo_bits/BaseCube_meat.hpp +++ b/include/armadillo_bits/BaseCube_meat.hpp @@ -431,7 +431,8 @@ BaseCube_eval_Cube::eval() const // extra functions defined in BaseCube_eval_expr template -arma_inline +inline +arma_warn_unused Cube BaseCube_eval_expr::eval() const { diff --git a/include/armadillo_bits/SpBase_bones.hpp b/include/armadillo_bits/SpBase_bones.hpp index b5c06883..137de447 100644 --- a/include/armadillo_bits/SpBase_bones.hpp +++ b/include/armadillo_bits/SpBase_bones.hpp @@ -31,7 +31,7 @@ struct SpBase_eval_SpMat template struct SpBase_eval_expr { - inline SpMat eval() const; //!< force the immediate evaluation of a delayed expression + inline arma_warn_unused SpMat eval() const; //!< force the immediate evaluation of a delayed expression }; diff --git a/include/armadillo_bits/SpBase_meat.hpp b/include/armadillo_bits/SpBase_meat.hpp index 9ce00352..3fc87cc6 100644 --- a/include/armadillo_bits/SpBase_meat.hpp +++ b/include/armadillo_bits/SpBase_meat.hpp @@ -330,6 +330,7 @@ SpBase_eval_SpMat::eval() const template inline +arma_warn_unused SpMat SpBase_eval_expr::eval() const {