Opened 14 years ago
Closed 14 years ago
#2354 closed Bugs (fixed)
Serialization of STL collections fails on 64-bit Linux platforms
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | Boost 1.37.0 | Component: | serialization |
Version: | Boost 1.36.0 | Severity: | Problem |
Keywords: | Cc: |
Description
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) 264 - 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.
I've fixed in my local copy. Assuming testing is successful, it will migrate to the release.