stan-dev/math

Boost unused variable warning

WardBrian opened this issue · 1 comments

Description

Since #3001 was merged, compiling anything downstream yields the following warning for me:

In file included from stan/lib/stan_math/lib/boost_1.84.0/boost/math/special_functions/beta.hpp:1721,
                 from stan/lib/stan_math/lib/boost_1.84.0/boost/math/special_functions/binomial.hpp:15,
                 from stan/lib/stan_math/stan/math/prim/fun/choose.hpp:7,
                 from stan/lib/stan_math/stan/math/prim/fun.hpp:46,
                 from stan/lib/stan_math/stan/math/rev/fun/multiply.hpp:7,
                 from stan/lib/stan_math/stan/math/rev/fun/elt_multiply.hpp:9,
                 from stan/lib/stan_math/stan/math/rev/fun.hpp:56,
                 from stan/lib/stan_math/stan/math/rev.hpp:12,
                 from stan/lib/stan_math/stan/math.hpp:19,
                 from stan/src/stan/model/model_header.hpp:4,
                 from ../../ml/stanc3/double-reject.hpp:2:
stan/lib/stan_math/lib/boost_1.84.0/boost/math/special_functions/detail/ibeta_inverse.hpp: In instantiation of ‘boost::math::detail::temme_root_finder<T>::temme_root_finder(T, T) [with T = double]’:
stan/lib/stan_math/lib/boost_1.84.0/boost/math/special_functions/detail/ibeta_inverse.hpp:304:7:   required from ‘T boost::math::detail::temme_method_2_ibeta_inverse(T, T, T, T, T, const Policy&) [with T = double; Policy = boost::math::policies::policy<boost::math::policies::pole_error<boost::math::policies::errno_on_error>, boost::math::policies::overflow_error<boost::math::policies::errno_on_error>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’
stan/lib/stan_math/lib/boost_1.84.0/boost/math/special_functions/detail/ibeta_inverse.hpp:615:48:   required from ‘T boost::math::detail::ibeta_inv_imp(T, T, T, T, const Policy&, T*) [with T = double; Policy = boost::math::policies::policy<boost::math::policies::pole_error<boost::math::policies::errno_on_error>, boost::math::policies::overflow_error<boost::math::policies::errno_on_error>, boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>]’
stan/lib/stan_math/lib/boost_1.84.0/boost/math/special_functions/detail/ibeta_inverse.hpp:992:30:   required from ‘boost::math::tools::promote_args_t<T1, T2, T3, T4> boost::math::ibeta_inv(T1, T2, T3, T4*, const Policy&) [with T1 = double; T2 = double; T3 = double; T4 = double; Policy = boost::math::policies::policy<boost::math::policies::overflow_error<boost::math::policies::errno_on_error>, boost::math::policies::pole_error<boost::math::policies::errno_on_error>, boost::math::policies::promote_double<false>, boost::math::policies::digits2<0>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>; boost::math::tools::promote_args_t<T1, T2, T3, T4> = double]’
stan/lib/stan_math/lib/boost_1.84.0/boost/math/special_functions/detail/ibeta_inverse.hpp:1023:20:   required from ‘boost::math::tools::promote_args_t<RT1, RT2, A> boost::math::ibeta_inv(RT1, RT2, RT3, const Policy&) [with RT1 = double; RT2 = double; RT3 = double; Policy = boost::math::policies::policy<boost::math::policies::overflow_error<boost::math::policies::errno_on_error>, boost::math::policies::pole_error<boost::math::policies::errno_on_error>, boost::math::policies::promote_double<false>, boost::math::policies::digits2<0>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy>; boost::math::tools::promote_args_t<RT1, RT2, A> = double]’
stan/lib/stan_math/stan/math/prim/fun/inv_inc_beta.hpp:32:32:   required from here
stan/lib/stan_math/lib/boost_1.84.0/boost/math/special_functions/detail/ibeta_inverse.hpp:29:15: warning: unused variable ‘x_extrema’ [-Wunused-variable]
   29 |       const T x_extrema = 1 / (1 + a);
      |       

Are there any objections to removing that line from the boost file? @andrjohns @SteveBronder

Current Version:

v4.8.1

The value calculated there is only used in a BOOST_MATH_ASSERT, but our makefiles always compile with -DBOOST_DISABLE_ASSERTS