id summary reporter owner description type status milestone component version severity resolution keywords cc 6191 Fix variable shadowing warning in igamma_inverse.hpp Vadim Zeitlin John Maddock "A local variable `s` is redefined in `find_inverse_gamma()` helper defined in the file `math/special_functions/detail/igamma_inverse.hpp` resulting in annoyingly long warnings from Sun CC compiler (see below for the warning in its full glory). I suspect other compilers (e.g. g++ with `-Wshadow`) would give this warning as well so I'd like to ask for the following trivial patch to be applied to fix it: {{{ #!diff --- igamma_inverse.hpp.orig Thu Dec 1 18:00:20 2011 +++ igamma_inverse.hpp Thu Dec 1 18:01:27 2011 @@ -279,7 +279,6 @@ { // DiDonato and Morris Eq 35: T v = log(p) + boost::math::lgamma(ap1, pol); - T s = 1; z = exp((v + w) / a); s = boost::math::log1p(z / ap1 * (1 + z / (a + 2))); z = exp((v + z - s) / a); }}} Removing the declaration and initialization shouldn't change the meaning of the existing code because the variable is not used before it's assigned below and the variable with the same name in enclosing scope is not used any more. But if you prefer you could also just rename this `s` in nested scope to something else (its initialization is still unneeded though). TIA! P.S. The warning: {{{ "".../boost/math/special_functions/detail/igamma_inverse.hpp"", line 282: Warning, wvarhidenmem: s hides the same name in an outer scope. "".../boost/math/special_functions/detail/igamma_inverse.hpp"", line 406: Where, temwhileinst: While instantiating ""boost::math::detail::find_inverse_gamma>(double, double, double, const boost::math::policies::policy&, bool*)"". "".../boost/math/special_functions/detail/igamma_inverse.hpp"", line 406: Where, teminstfrom: Instantiated from boost::math::detail::gamma_p_inv_imp>(double, double, const boost::math::policies::policy&). "".../boost/math/special_functions/detail/igamma_inverse.hpp"", line 517: Where, teminstend: Instantiated from non-template code. }}} " Patches closed To Be Determined math Boost 1.48.0 Cosmetic fixed