Subject: [Boost-bugs] [Boost C++ Libraries] #8720: Fix for boost serialisation, portable binary archive on AIX
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-06-21 12:10:32
#8720: Fix for boost serialisation, portable binary archive on AIX
-------------------------------------+---------------------------
Reporter: avi.bahra@⦠| Owner: ramey
Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost 1.52.0 | Severity: Showstopper
Keywords: PORTABLE_BINARY_ARCHIVE |
-------------------------------------+---------------------------
On most platforms, char is signed, however on AIX by default char is
unsigned.
The portable binary archive assumes the char type is signed.
The fix is simply to replace 'char' with 'signed char' in the correct
places.
This is a fairly safe and quick fix, can I please ask the authors of this
library to add this fix, for the next version of boost.
Here are the changes I made: (flagged under ' // changed ' comment
//--------------------------------------------------------
portable_binary_iarchive.hpp
void load(signed char & t){ // changed
this->primitive_base_t::load(t);
}
//-------------------------------------------------------------
portable_binary_iarchive.cpp
void
portable_binary_iarchive::load_impl(boost::intmax_t & l, char maxsize){
signed char size; // changed
l = 0;
this->primitive_base_t::load(size);
if(0 == size){
return;
}
bool negative = (size < 0);
......
// -----------------------------------------------------------------
portable_binary_oarchive.hpp
void save(const signed char & t){ // changed
this->primitive_base_t::save(t);
}
// -----------------------------------------------------------
portable_binary_oarchive.cpp
void
portable_binary_oarchive::save_impl(
const boost::intmax_t l,
const char maxsize
){
signed char size = 0; // changed
if(l == 0){
this->primitive_base_t::save(size);
return;
}
..........
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8720> 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:13 UTC