id summary reporter owner description type status milestone component version severity resolution keywords cc 6192 Fix warnings passing non-POD to vararg function in math/special_functions/fpclassify.hpp Vadim Zeitlin John Maddock "Sun CC (and probably any other compiler for which `BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS` is defined) warns about passing non-POD struct to vararg `is_generic_tag_false()` overload. While this is probably harmless in practice because the function doesn't use its argument anyhow (and normally shouldn't be even called as it should be optimized away), it still results in nasty warnings (see below for the full text) so I suggest the following simple patch which just switches to using pointers instead of objects to fix this: {{{ #!diff --- boost_1_41_0.orig/boost/math/special_functions/fpclassify.hpp Thu Dec 1 19:03:56 2011 +++ boost_1_41_0/boost/math/special_functions/fpclassify.hpp Thu Dec 1 19:04:48 2011 @@ -251,7 +251,8 @@ typedef typename detail::fp_traits::type traits; typedef typename traits::method method; #ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS - if(std::numeric_limits::is_specialized && detail::is_generic_tag_false(method())) + if(std::numeric_limits::is_specialized && + detail::is_generic_tag_false(static_cast(NULL))) return detail::fpclassify_imp(t, detail::generic_tag()); return detail::fpclassify_imp(t, method()); #else --- boost_1_41_0.orig/boost/math/special_functions/detail/fp_traits.hpp Thu Dec 1 19:04:06 2011 +++ boost_1_41_0/boost/math/special_functions/detail/fp_traits.hpp Thu Dec 1 19:06:45 2011 @@ -101,11 +101,11 @@ // These helper functions are used only when numeric_limits<> // members are not compile time constants: // -inline bool is_generic_tag_false(const generic_tag&) +inline bool is_generic_tag_false(const generic_tag*) { return true; } -inline bool is_generic_tag_false(...) +inline bool is_generic_tag_false(const void*) { return false; } }}} While the patch is against the old 1.41 release and not the trunk, the relevant code doesn't seem to have changed since then. P.S. For the reference, here are the warnings: {{{ "".../boost/math/special_functions/fpclassify.hpp"", line 254: Warning, nonpodvarargw: A non-POD object of type ""boost::math::detail::ieee_copy_leading_bits_tag"" passed as a variable argument to function ""boost::math::detail::is_generic_tag_false(...)"". "".../boost/math/special_functions/gamma.hpp"", line 591: Where, temwhileinst: While instantiating ""boost::math::fpclassify(long double)"". "".../boost/math/special_functions/gamma.hpp"", line 591: Where, teminstfrom: Instantiated from boost::math::detail::full_igamma_prefix, boost::math::policies::promote_double<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::policies::default_policy, boost::math::policies::default_policy>>(long double, long double, const boost::math::policies::policy, boost::math::policies::promote_double<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::policies::default_policy, boost::math::policies::default_policy>&). "".../boost/math/special_functions/gamma.hpp"", line 977: Where, teminstfrom: Instantiated from boost::math::detail::gamma_incomplete_imp, boost::math::policies::promote_double<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::policies::default_policy, boost::math::policies::default_policy>>(long double, long double, bool, bool, const boost::math::policies::policy, boost::math::policies::promote_double<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::policies::default_policy, boost::math::policies::default_policy>&, long double*). "".../boost/math/special_functions/gamma.hpp"", line 1444: Where, teminstend: Instantiated from non-template code. }}} " Patches closed To Be Determined math Boost 1.48.0 Cosmetic fixed