Boost logo

Boost :

Subject: Re: [boost] [Serialization] warnings and maybe a 'bug'
From: Christoph Duelli (duelli_at_[hidden])
Date: 2009-11-09 12:27:10

Robert Ramey wrote:

> Christoph Duelli wrote:
>> I also get lots of
>> boost::archive::detail::<unnamed>::init_guid<XXXX>::g' defined but
>> not used where XXXX is some class name of mine
> Is it possible that the class is marked "EXPORT" when this is not
> in fact necessary?
Well, when *is* it necessary?
The serialization code for classes are usually looks like this:


void Node::serialize(InArchive & ar, const unsigned int /* file_version */){
      & ... ;
void Node::serialize(OutArchive & ar, const unsigned int /* file_version */
      & ... ;

Maybe I have misunderstood when I need to used BOOST_CLASS_EXPORT_GUID; I
will read up on that again.

>> ii) maybe a 'bug' (code does no longer compile)
>> Code that used to compile with Boost 1.40 does no longer compile with
>> the
>> 1.41 beta:
>> (I had no time to investigate yet; in case it is obvious for you once
>> you
>> see the code I have decided to include this point in this posting):
>> boost/archive/shared_ptr_helper.hpp:114: error: cannot convert 'const
>> boost::serialization::extended_type_info_typeid<MEPfad>' to 'const
>> boost::serialization::extended_type_info*' in return
>> (where MEPfad is a class of mine)
> In this case the code actually looks wrong to me. I'm curious why it
> never failed any tests. If you have a small bit of source which traps
> this problem, I would be curious to see it.
I have created a stripped down example that exhibits the error.
(Basic ingredients: shared_ptr, binary_iarchive.)
See attachment.

btw, I get a few of those as well (out of BOOST_CLASS_EXPORT_GUID uses):
boost/mpl/print.hpp:55: warning: comparison between signed and unsigned
integer expressions

Boost list run by bdawes at, gregod at, cpdaniel at, john at