[serialization] Serializing "int" types...

If I choose to serialize a variable with type "int", is this portable? For example, if I stream out this value on a 64-bit system, and then load it in on a 32-bit system, will this result in a buffer-overrun or anything else weird? I read the serialization docs but didn't see this topic in there. Sorry if I missed it. Help is appreciated. Thank you.

I guess this covers it?
http://www.boost.org/doc/libs/1_38_0/libs/serialization/doc/special.html#num...
On Thu, Apr 2, 2009 at 4:02 PM, Robert Dailey
If I choose to serialize a variable with type "int", is this portable? For example, if I stream out this value on a 64-bit system, and then load it in on a 32-bit system, will this result in a buffer-overrun or anything else weird? I read the serialization docs but didn't see this topic in there. Sorry if I missed it.
Help is appreciated. Thank you.

Hi Robert You're right. I definitively recommend the use of 'boost/cstdint.h' stuff to store/load integers (16/32 signed or not). I use it on both 32 and 64 bits Linux boxes. As far as I know, it gives fully portable archives. regards frc --
I guess this covers it? http://www.boost.org/doc/libs/1_38_0/libs/serialization/doc/special.html#num...
On Thu, Apr 2, 2009 at 4:02 PM, Robert Dailey
wrote: If I choose to serialize a variable with type "int", is this portable? For example, if I stream out this value on a 64-bit system, and then load it in on a 32-bit system, will this result in a buffer-overrun or anything else weird? I read the serialization docs but didn't see this topic in there. Sorry if I missed it.
Help is appreciated. Thank you.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Francois Mauger Laboratoire de Physique Corpusculaire de Caen et Universite de Caen ENSICAEN - 6, Boulevard du Marechal Juin, 14050 CAEN Cedex, FRANCE e-mail: mauger@lpccaen.in2p3.fr tel.: (0/+33) 2 31 45 25 12 fax: (0/+33) 2 31 45 25 49
participants (2)
-
François Mauger
-
Robert Dailey