New version of mpl_math in the vault; problems compiling...
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
--- Fredrik Hedman wrote:
Hello,
Howdy!
I have been playing around with the examples of this fascinating code.
I didn't know members of the boost-users list were paying attention to the vault. I should start posting announcements here.
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'
Cool. Our current development environments are msvc 7.1 and g++ 3.4.2 (mingw).
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.
I intentionally removed it. The proper syntax for
big_integral is no longer
big_integral
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?
I'm not sure if Peder Holt subscribes to this list, so I've CC'ed him.
3) The example big_integral.cpp complains about extra semicolons.
Thanks for catching the typos! Cromwell D. Enage __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
On Friday 21 October 2005 16.40, Cromwell Enage wrote:
--- Fredrik Hedman wrote:
Hello,
Howdy!
I have been playing around with the examples of this fascinating code.
I didn't know members of the boost-users list were paying attention to the vault. I should start posting announcements here.
I wasn't sure where I should post about the problems compiling the examples; if you think I should have sent it elsewhere, please let me know. In any case, I think your routines for MPL are *very* cool; they make an amazing library even more amazing;) -- Best Regards, Fredrik Hedman
--- Fredrik Hedman wrote:
I wasn't sure where I should post about the problems compiling the examples; if you think I should have sent it elsewhere, please let me know.
This list is fine for bug reports and even reviews. But if you want to lend a hand in actual development (e.g. implementing fast division for big_integral), the main boost list is the place to stay current.
In any case, I think your routines for MPL are *very* cool; they make an amazing library even more amazing;)
Many thanks for your enthusiasm :D Cromwell D. Enage __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
participants (2)
-
Cromwell Enage
-
Fredrik Hedman