RE: [boost] [test] [minmax] failure on gcc 2.95

As shown in http://tinyurl.com/3xdyq, Boost.Test fails to build on gcc 2.95 with stlport. The error message is:
/boost/head-regression/boost/boost/minmax.hpp: In function `const size_t & boost::std_min<size_t>(const size_t &, const size_t &)':
/boost/head-regression/boost/libs/test/build/../src/test_tools .cpp:375: instantiated from here /boost/head-regression/boost/boost/minmax.hpp:26: `min' undeclared (first use this function)
Is it possible that authors of either Boost.Test or boost/minmax.hpp take care of this error?
I'd prefer it to be addressed on minmax.hpp level. After all it's the header responsible for min and max. Gennadiy.

Rozental, Gennadiy wrote:
As shown in http://tinyurl.com/3xdyq, Boost.Test fails to build on gcc 2.95 with stlport. The error message is:
/boost/head-regression/boost/boost/minmax.hpp: In function `const size_t & boost::std_min<size_t>(const size_t &, const size_t &)':
/boost/head-regression/boost/libs/test/build/../src/test_tools .cpp:375: instantiated from here /boost/head-regression/boost/boost/minmax.hpp:26: `min' undeclared (first use this function)
Is it possible that authors of either Boost.Test or boost/minmax.hpp take care of this error?
I'd prefer it to be addressed on minmax.hpp level. After all it's the header responsible for min and max.
Gennadiy.
Yes, I have been meaning to rip out minmax.hpp for quite some time. I'll give the task a priority bump. -- Eric Niebler Boost Consulting www.boost-consulting.com

Rozental, Gennadiy wrote:
As shown in http://tinyurl.com/3xdyq, Boost.Test fails to build on gcc 2.95 with stlport. The error message is:
/boost/head-regression/boost/boost/minmax.hpp: In function `const size_t & boost::std_min<size_t>(const size_t &, const size_t &)':
/boost/head-regression/boost/libs/test/build/../src/test_tools .cpp:375: instantiated from here /boost/head-regression/boost/boost/minmax.hpp:26: `min' undeclared (first use this function)
Is it possible that authors of either Boost.Test or boost/minmax.hpp take care of this error?
I'd prefer it to be addressed on minmax.hpp level. After all it's the header responsible for min and max.
I tested the problem with this simple snippet: #include <boost/minmax.hpp> int foo() { return boost::std_min(3, 4); } The error goes away when I replace using std::min; return min BOOST_PREVENT_MACRO_SUBSTITUTION ( a, b ); by return std::min(a, b); in boost/minmax.hpp. (This would, of course, break other compilers/libraries) gcc-2.95.3 without STLPort doesn't require that change, but works fine with it, too. Regards, m

Martin Wille wrote:
I tested the problem with this simple snippet:
#include <boost/minmax.hpp> int foo() { return boost::std_min(3, 4); }
The error goes away when I replace
using std::min; return min BOOST_PREVENT_MACRO_SUBSTITUTION ( a, b );
by
return std::min(a, b);
The problem with the above is that it is not semantically equivalent. The first does argument-dependent lookup, the second does not. I'll be ripping out std_min/std_max in the next few days, but I'll essentially be replacing it with: using std::min; return min BOOST_PREVENT_MACRO_SUBSTITUTION ( a, b ); everywhere. gcc-2.95/STLPort will not be happy with this, I assume. I don't have this platform to test on. I need to understand what the problem is so I can work around it. Can someone with access to this platform tell me what the problem is? Is min/max not in the std:: namespace? What is the issue, exactly? Thanks. -- Eric Niebler Boost Consulting www.boost-consulting.com
participants (3)
-
Eric Niebler
-
Martin Wille
-
Rozental, Gennadiy