Opened 7 years ago

Last modified 7 years ago

#11594 new Bugs

mpl/test/string.cpp fails, test needs to take into account endianness.

Reported by: Aparna Kumta <aparna.kumta@…> Owned by: Aleksey Gurtovoy
Milestone: To Be Determined Component: mpl
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

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_::failedboost::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_::failedboost::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_::failedboost::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_::failedboost::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_::failedboost::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_::failedboost::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. %

Change History (1)

comment:1 by Aparna Kumta <aparna.kumta@…>, 7 years ago

Note: See TracTickets for help on using tickets.