Boost logo

Boost Users :

Subject: [Boost-users] Bug: serialization of STL collections on Linux x86-64.
From: Ivan Godard (igodard_at_[hidden])
Date: 2008-09-20 19:05:22


In boost 1.35 on Linux on x86-64 an attempt to serialize any of the STL
collections produces multiple definitions of implementation_level.
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.

I don't know if this has already been fixed in 1.36; I don't have a copy
handy.

Ivan Godard



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net