Boost logo

Boost Users :

Subject: Re: [Boost-users] serialization of STL collections on Linux x86-64.
From: Robert Ramey (ramey_at_[hidden])
Date: 2008-09-21 12:43:31


I made this change on my local copy. It will eventually migrate to the release ready branch.

Robert Ramey
  "Ivan Godard" <igodard_at_[hidden]> wrote in message news:48D581B2.4030603_at_pacbell.net...
  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 mailing list
  Boost-users_at_[hidden]
  http://lists.boost.org/mailman/listinfo.cgi/boost-users



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