Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5499: Serialization backward compatability
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-26 10:59:51
#5499: Serialization backward compatability
-------------------------------------+--------------------------------------
Reporter: ybungalobill@⦠| Owner: ramey
Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost 1.46.1 | Severity: Showstopper
Resolution: | Keywords: serialization compatability
-------------------------------------+--------------------------------------
Comment (by s.skorniakov@â¦):
Same problem while upgrading from 1.36.0 to 1.48.0.
I had checked basic_binary_iarchive::load_override for class_id_type -
from versions 1.32.0 to 1.43.0 (serialization library versions from 3 to
7) its identical:
{{{
void load_override(class_id_type & t, int){
// upto 32K classes
int_least16_t x;
* this->This() >> x;
t = class_id_type(x);
}
}}}
In version 1.44.0 (library version 8) load_override for class_id_type is
not specialized in basic_binary_iarchive.
In version 1.48.0 I see
{{{
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_iarchive::load_override(t, version);
}
else
if(boost::archive::library_version_type(6) < lvt){
int_least16_t x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
else{
int x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
}}}
I do not understand, why author made difference between version 7 and
earlier versions. From my point of view, it is an error (introduced in
version 1.45.0). Following code can read my old files (library versions
3-5) :
{{{
void load_override(class_id_type & t, int version){
library_version_type lvt = this->get_library_version();
if(boost::archive::library_version_type(7) < lvt){
this->detail_common_iarchive::load_override(t, version);
}
else
{
int_least16_t x=0;
* this->This() >> x;
t = boost::archive::class_id_type(x);
}
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5499#comment:1> 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:08 UTC