[Boost-bugs] [Boost C++ Libraries] #2354: Serialization of STL collections fails on 64-bit Linux platforms

Subject: [Boost-bugs] [Boost C++ Libraries] #2354: Serialization of STL collections fails on 64-bit Linux platforms
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-09-20 22:48:24


#2354: Serialization of STL collections fails on 64-bit Linux platforms
---------------------------------+------------------------------------------
 Reporter: igodard_at_[hidden] | Owner: ramey
     Type: Bugs | Status: new
Milestone: Boost 1.37.0 | Component: serialization
  Version: Boost 1.36.0 | Severity: Problem
 Keywords: |
---------------------------------+------------------------------------------
 In boost 1.35 on Linux on x86-64 an attempt to serialize any of the STL
 collections produces multiple definitions of "implementation_level<long
 int>". Eventually I tracked these to the int64_t handling in
 collection_traits.hpp, where the following code appears:

     // determine if its necessary to handle (u)int64_t specifically
     // i.e. that its not a synonym for (unsigned) long
     // if there is no 64 bit int or if its the same as a long
     // we shouldn't define separate functions for int64 data types.
     #if defined(BOOST_NO_INT64_T) \
         || (ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615u)
 // 2**64 - 1
     # define BOOST_NO_INTRINSIC_INT64_T
     #endif

 The bug is that the lengthy constant is just "u", and so will be compiler-
 truncated to unsigned int, 4 bytes on this platform, and so will fail to
 be equal to the 8-byte ULONG_MAX. Changing the "u" to "ul" fixes the bug.

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2354>
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:49:58 UTC