
Investigating a bit further, I discovered that we are actually passing -funsigned-char to the compiler. This causes a problem because:
common_factor_rt.hpp:329 BOOST_PRIVATE_GCD_SF( char, unsigned char ); // should work even if unsigned
This macro expands into: common_factor_rt.hpp:317 #define BOOST_PRIVATE_GCD_SF( St, Ut ) \ template < > struct gcd_optimal_evaluator<St> \ { St operator ()( St a, St b ) const { Ut const a_abs = \ static_cast<Ut>( a < 0 ? -a : +a ), b_abs = static_cast<Ut>( \ b < 0 ? -b : +b ); return static_cast<St>( \ gcd_optimal_evaluator<Ut>()(a_abs, b_abs) ); } }
The expression 'a < 0' is always false if 'a' is unsigned, so the compiler issues a warning (if warnings are turned high enough).
My impression is that this code should be considered incorrect - making assumptions about the signed-ness of char is not portable. I do not understand why the comment suggests that this "should work".
Actually I think in this case the code will work correctly, but in any case this patch should fix things: https://svn.boost.org/trac/boost/changeset/63496/trunk/boost/math/common_fac... HTH, John.