Opened 9 years ago
#8720 new Bugs
Fix for boost serialisation, portable binary archive on AIX
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | To Be Determined | Component: | serialization |
Version: | Boost 1.52.0 | Severity: | Showstopper |
Keywords: | PORTABLE_BINARY_ARCHIVE | Cc: |
Description
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;
}
..........