|
Boost : |
From: Michael Stevens (Michael.Stevens_at_[hidden])
Date: 2004-08-16 06:16:11
The 'random_test' has been failing on GCC-3.3 for quite some time...
Looking a bit deeper the failure was rather nasty resulting in a infinite
recursion. A lot of waist CPU and memory usage when running regression tests!
The problem is GCC-3.3 specific and cause by a compiler bug. It was
inadvertently introduced by Eric minmax workarounds.
Specificly the 'max' member functions of class ruetti_gen in
"random_test.cpp" and class rand48 in "linear_congruential.hpp" were defined:
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ return (std::numeric_limits<result_type>::max)(); }
Amazingly these are recursing, with max calling itseld rather then the correct
max from numeric_limits! I have committed a fix which uses a different syntax
thus:
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{ return std::numeric_limits<result_type>::max
BOOST_PREVENT_MACRO_SUBSTITUTION (); }
Eric, is this correct from a minmax macro point of view?
-- ___________________________________ Michael Stevens Systems Engineering Navigation Systems, Estimation and Bayesian Filtering http://bayesclasses.sf.net ___________________________________
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk