Subject: [Boost-bugs] [Boost C++ Libraries] #11594: mpl/test/string.cpp fails, test needs to take into account endianness.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-08-27 17:29:00
#11594: mpl/test/string.cpp fails, test needs to take into account endianness.
-------------------------------------------+-----------------------
Reporter: Aparna Kumta <aparna.kumta@â¦> | Owner: agurtovoy
Type: Bugs | Status: new
Milestone: To Be Determined | Component: mpl
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------------+-----------------------
Compiling mpl/test/string.cpp with Oracle Solaris Studio 12.4 on sparc-S2
platform, the test fails as follows:
%
CC -compat=5 -library=stlport4 -xO4 -mt -erroff=%none -m64 -KPIC
-DBOOST_ALL_NO_LIB=1 -DNDEBUG -I.. -c -o ./string.o
../libs/mpl/test/string.cpp
"../libs/mpl/test/string.cpp", line 66: Warning: Multi-character character
literal 'aaaa'.
"../libs/mpl/test/string.cpp", line 66: Warning: Multi-character character
literal 'aaaa'.
...
...
"../libs/mpl/test/string.cpp", line 140: Error: Formal argument 1 of type
mpl_::assert<0> in call to mpl_::assertion_failed<0>(mpl_::assert<0>) is
being passed
mpl_::failed************boost::is_same<boost::mpl::string<25185, 0, 0, 0,
0, 0, 0, 0>, boost::mpl::string<24930, 0, 0, 0, 0, 0, 0,
0>>::************.
"../libs/mpl/test/string.cpp", line 143: Error: Formal argument 1 of type
mpl_::assert<0> in call to mpl_::assertion_failed<0>(mpl_::assert<0>) is
being passed
mpl_::failed************boost::is_same<boost::mpl::string<6513249, 0, 0,
0, 0, 0, 0, 0>, boost::mpl::string<6382179, 0, 0, 0, 0, 0, 0,
0>>::************.
"../libs/mpl/test/string.cpp", line 146: Error: Formal argument 1 of type
mpl_::assert<0> in call to mpl_::assertion_failed<0>(mpl_::assert<0>) is
being passed
mpl_::failed************boost::is_same<boost::mpl::string<1684234849, 0,
0, 0, 0, 0, 0, 0>, boost::mpl::string<1633837924, 0, 0, 0, 0, 0, 0,
0>>::************.
"../libs/mpl/test/string.cpp", line 149: Error: Formal argument 1 of type
mpl_::assert<0> in call to mpl_::assertion_failed<0>(mpl_::assert<0>) is
being passed
mpl_::failed************boost::is_same<boost::mpl::string<1684234849, 101,
0, 0, 0, 0, 0, 0>, boost::mpl::string<1633837924, 101, 0, 0, 0, 0, 0,
0>>::************.
...
"../libs/mpl/test/string.cpp", line 319: Error: Formal argument 1 of type
mpl_::assert<0> in call to mpl_::assertion_failed<0>(mpl_::assert<0>) is
being passed
mpl_::failed************boost::is_same<boost::mpl::string<1633771864,
1633771873, 1633771873, 1633771873, 1633771873, 1633771873, 1633771873,
1633771873>, boost::mpl::string<1482776929, 1633771873, 1633771873,
1633771873, 1633771873, 1633771873, 1633771873,
1633771873>>::************.
"../libs/mpl/test/string.cpp", line 321: Warning: Multi-character
character literal 'aaaa'.
"../libs/mpl/test/string.cpp", line 323: Error: Formal argument 1 of type
mpl_::assert<0> in call to mpl_::assertion_failed<0>(mpl_::assert<0>) is
being passed
mpl_::failed************boost::is_same<boost::mpl::string<1633771864,
1633771873, 1633771873, 0, 0, 0, 0, 0>, boost::mpl::string<1482776929,
1633771873, 1633771873, 0, 0, 0, 0, 0>>::************.
Compilation aborted, too many Error messages.
%
In boost/mpl/string.hpp:
#if defined(BOOST_ENDIAN_LITTLE_BYTE) && defined(__SUNPRO_CC)
...
#else
...
condition should be fixed to correctly detect endiannes.
The following change causes the testcase to compile.
diff string.hpp string.hpp_new
62c62
< #if defined(BOOST_ENDIAN_LITTLE_BYTE) && defined(__SUNPRO_CC)
---
> #if BOOST_ENDIAN_LITTLE_BYTE && defined(__SUNPRO_CC)
With this change, the result is:
CC -compat=5 -library=stlport4 -xO4 -mt -erroff=%none -m64 -KPIC
-DBOOST_ALL_NO_LIB=1 -DNDEBUG -I.. -c -o ./string.o
../libs/mpl/test/string.cpp
"../libs/mpl/test/string.cpp", line 66: Warning: Multi-character character
literal 'aaaa'.
...
"../libs/mpl/test/string.cpp", line 363: Warning: Multi-character
character literal 'el'.
72 Warning(s) detected.
%
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11594> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC