[Boost-bugs] [Boost C++ Libraries] #10991: cstdint.hpp doesn't work correctly on Solaris.

Subject: [Boost-bugs] [Boost C++ Libraries] #10991: cstdint.hpp doesn't work correctly on Solaris.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-02 22:22:47


#10991: cstdint.hpp doesn't work correctly on Solaris.
-------------------------------------------+-------------------------
 Reporter: Aparna Kumta <aparna.kumta@…> | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: config
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------------+-------------------------
 Issue: Several tests(over 100) fail when compiling with Oracle Solaris
 Studio 12.4 compiler on Solaris 11.2. An example is shown below:

 CC -compat=5 -library=stlport4 -xO4 -erroff=%none -DBOOST_ALL_NO_LIB=1
 -DBOOST_CHRONO_STATIC_LINK=1 -DBOOST_CHRONO_THREAD_DISABLED
 -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_SYSTEM_STATIC_LINK=1
 -DBOOST_TEST_NO_AUTO_LINK=1 -DBOOST_TIMER_STATIC_LINK=1 -DNDEBUG
 -D__typeof__=__typeof__ -I.. -c -o ./extended_p_square_quantile.o
 ../libs/accumulators/test/extended_p_square_quantile.cpp [[BR]]

 "../boost/random/detail/polynomial.hpp", line 30: Error: uintptr_t is not
 a member of boost. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 33: Error: Type name
 expected instead of "digit_t". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 41: Error: Type name
 expected instead of "digit_t". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 58: Error: Type name
 expected instead of "digit_t". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 76: Error: Type name
 expected instead of "digit_t". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 104: Error: Type name
 expected instead of "digit_t". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 113: Error: Type name
 expected instead of "digit_t". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 121: Error: Type name
 expected instead of "digit_t". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 140: Error: Type name
 expected instead of "digit_t". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 167: Error: A value of type
 void is not allowed. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 167: Error: Unexpected type
 name "digit_t" encountered. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 167: Error: val is not
 defined. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 167: Error: Unexpected type
 name "std::size_t" encountered. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 167: Error: size is not
 defined. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 167: Error: Badly formed
 expression. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 191: Error: A value of type
 void is not allowed. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 191: Error: Unexpected type
 name "digit_t" encountered. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 191: Error: val is not
 defined. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 191: Error: Unexpected type
 name "std::size_t" encountered. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 191: Error: size is not
 defined. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 191: Error: Badly formed
 expression. [[BR]]
 "../boost/random/detail/polynomial.hpp", line 225: Error: Identifier
 expected instead of "(". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 225: Error: In this
 declaration "(" is of an incomplete type "void". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 225: Error: "," expected
 instead of "(". [[BR]]
 "../boost/random/detail/polynomial.hpp", line 240: Error: Unexpected type
 name "digit_t" encountered. [[BR]]
 Compilation aborted, too many Error messages. [[BR]]

 Reason: The boost/cstdint.hpp file which defines boost::uintptr_t, does
 not take into account that on Solaris uintptr_t is defined under
 /usr/include/sys/int_types.h. [[BR]]

 Solution: The following diff resolves the issue. [[BR]]

 % diff ./cstdint.hpp ./cstdint.hpp_new [[BR]]
 393a394,403 [[BR]]
> #elif defined(__SUNPRO_CC) [[BR]]
> [[BR]]
> #include <sys/int_types.h> [[BR]]
> namespace boost { [[BR]]
> using ::intptr_t; [[BR]]
> using ::uintptr_t; [[BR]]
> } [[BR]]
> [[BR]]
> #define BOOST_HAS_INTPTR_T [[BR]]
> [[BR]]

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10991>
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:17 UTC