boost serialisation, PORTABLE_BINARY_ARCHIVE fix required
Currently portable binary archive is broken on AIX platforms. The reason is because the default 'char' type is unsigned on this platform. Whereas for most other platforms it is signed, By going through the portable binary and replacing 'char' with 'signed char' this long standing bug is fixed. I have tested the fix on Linux(opensuse103,opensuse113, HPUX, AIX(power6,power7) 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; } .......... // ------------------------------ Ta, Avi
On Thu, Jun 20, 2013 at 11:22 AM, avib369 .
By going through the portable binary and replacing 'char' with 'signed char' this long standing bug is fixed. I have tested the fix on Linux(opensuse103,opensuse113, HPUX, AIX(power6,power7)
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.
Based on previous replies to such requests, I'm going to guess that they're going to ask you to file a Trac ticket with a patch file.
participants (2)
-
avib369 .
-
Nat Linden