|
Boost Users : |
From: Fredrik Hedman (hedman_at_[hidden])
Date: 2005-10-21 05:30:28
Hello,
I have been playing around with the examples of this fascinating code.
This reports on the problems I have encountered so far. The
latest examples are compiled with g++ 3.4.4 and '-Wall -Wno-long-long
-pedantic -O2' using using boost-1_33 result in a
number of errors:
1) The example in runtime_value.cpp gives
boost/mpl/math/number_sign.hpp: No such file or directory
This files seems to be missing.
2) The example double.cpp get a *lot* of warnings:
mpl/math/double_/aux_/integral_exp.hpp:35: warning:
comparison between signed and unsigned integer
expressions
Looking at the offending line it seems that the
constants that are shifted should really be unsigned
numbers:
BOOST_STATIC_CONSTANT(
boost::int16_t
, exp1 = (number < (1 << (exp16 + exp8 + exp4 + exp2 + 1))) ? 0 : 1
->
BOOST_STATIC_CONSTANT(
boost::int16_t
, exp1 = (number < (1u << (exp16 + exp8 + exp4 + exp2 + 1))) ? 0 : 1
The same should probably be applied to all the other
BOOST_STATIC_CONSTANT in struct integral_exp. Refactor
1u and 65536u into named constants?
3) The example big_integral.cpp complains about extra
semicolons. It is the macro
BOOST_MPL_MATH_BIG_INTEGRAL_AUX_CONVERT_IMPL_APPLY_RESULT
in convert_base10_digits.hpp that is the root cause.
By commenting out two ';' in the macro the example
compiles and runs just fine:
#define BOOST_MPL_MATH_BIG_INTEGRAL_AUX_CONVERT_IMPL_APPLY_RESULT \
BOOST_STATIC_CONSTANT( \
boost::uint32_t \
, a_0_0 = \
BOOST_PP_CAT( \
base10000_digit_ \
, BOOST_PP_DEC(BOOST_MPL_MATH_BIG_INTEGRAL_MANTISSA_SIZE) \
) \
); \
BOOST_PP_REPEAT( \
BOOST_PP_DEC(BOOST_MPL_MATH_BIG_INTEGRAL_MANTISSA_SIZE) \
, BOOST_MPL_MATH_BIG_INTEGRAL_AUX_A_0_MACRO \
, a_0_ \
) /* ; removed extra */ \
BOOST_PP_FOR( \
(0) \
, BOOST_MPL_MATH_BIG_INTEGRAL_AUX_CONVERT_IMPL_PREDICATE_0 \
, BOOST_MPL_MATH_BIG_INTEGRAL_AUX_CONVERT_IMPL_NEXT_STATE_0 \
, BOOST_MPL_MATH_BIG_INTEGRAL_AUX_CONVERT_IMPL_MACRO_0 \
) \
public: \
BOOST_PP_REPEAT( \
BOOST_MPL_MATH_BIG_INTEGRAL_MANTISSA_SIZE \
, BOOST_MPL_MATH_BIG_INTEGRAL_AUX_CONVERT_IMPL_MACRO_1 \
, digit_ \
) /* ; removed extra */ \
/**/
-- Best Regards, Fredrik Hedman
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net