Boost logo

Boost Users :

Subject: Re: [Boost-users] cross-platfrom binary serialization?
From: Pfligersdorffer, Christian (Christian.Pfligersdorffer_at_[hidden])
Date: 2008-09-17 08:43:44


So,

I drew the consequences from the quite lengthy discussion and released a
new version of my portable binary archives on the boost vault:

http://www.boostpro.com/vault/index.php?directory=serialization

In case of integer serialization I removed the warnings and floating
point serialization I complemented with a couple of checks whether
preconditions are met on the platform at hand. Thanks to everybody for
your tipps and sharing your wisdom!

Remember that the archives were tested only against boost 1.33 (and 1.34
a little) but so far I have not had time to look into the newer
versions.

Let me know if it works for you,

--
Christian Pfligersdorffer
Software Engineering
http://www.eos.info
 
Johan Rade on Saturday, September 06, 2008 12:07 PM:
> Pfligersdorffer, Christian wrote:
>> Bo Peng on Tuesday, September 02, 2008 5:09 PM:
>> 
>>>> I do not think
>>>> I want to be the one who tries to satisfy everybody. That's a
>>>> daunting task...
>>> I will use your version of portable binary archive as long as there
>>> is a way to test its compatibility with the underlying system...
>>> Just something like "whoops, this system is not
>>> IEEE754 compatible so archives created on this system will not be
>>> portable".
>> 
>> It's not straight forward to do such a test but I will have a look at
>> it for the next release. Johan Rade does a classication of floating
>> point formats in his fp_utilities. I'll see if I can use that.
> 
> In practice almost all platforms have float and double
> implementations that are enough IEEE 754 compliant to make it
> ok to save the bytes and load them again.
> 
> The only exceptions I know of are:
>      1. some compilers have a setting where denormals,
> infinity and Nan are not used
>      2. on VMS there is still support for the VAX floating
> point format
> 
> Condition 1 can be detected by numeric_limits<T>::has_denorm etc.
> Condition 2 can be detected as follows
>      #if defined(__vms) && defined(__DECCXX) && !__IEEE_FLOAT
> 
> Also note that the bit patterns that represent quiet NaN on
> one platform can represent signaling NaN on other platforms.
> But very few C++ developers seem to care about the difference
> between quiet and signaling NaN.
> 
> And forget about portable binary serialization of long double
> (unless you want to do a lot of work).

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