1.39 serialisation: buggy warning message for shared_ptr
When I want to serialise a vector of shared ptrs to concrete types, there are no warnings on gcc/Linux. and program runs correctly. However when I compile on HP-UX, I get the following: .../boost_1_39_0/boost/serialization/export.hpp", line 137: warning #2414-D: delete of pointer to incomplete class BOOST_STATIC_WARNING(boost::is_polymorphic<T>::value); .... It appears that boost shared ptr serialisation has made the assumption that the pointer must be polymorphic! Is this assumption correct ? i.e are we allowed to serialize shared ptrs to concrete types ? To get rid of the message I simply add a virtual member function. It appears in this case that HPUX compiler is more accurate, and I don't understand why this same warning does not appear with gcc. Best regards, Ta, Avi
The only reason to export a type is if one needs to serialize it through a base class pointer. So, to me the best way to suppress the warning would be to not export the type. Robert Ramey Avi Bahra wrote:
When I want to serialise a vector of shared ptrs to concrete types, there are no warnings on gcc/Linux. and program runs correctly. However when I compile on HP-UX, I get the following:
.../boost_1_39_0/boost/serialization/export.hpp", line 137: warning #2414-D: delete of pointer to incomplete class BOOST_STATIC_WARNING(boost::is_polymorphic<T>::value); ....
It appears that boost shared ptr serialisation has made the assumption that the pointer must be polymorphic! Is this assumption correct ? i.e are we allowed to serialize shared ptrs to concrete types ?
To get rid of the message I simply add a virtual member function.
It appears in this case that HPUX compiler is more accurate, and I don't understand why this same warning does not appear with gcc.
Best regards, Ta, Avi
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On Wed, Feb 24, 2010 at 10:55 AM, Avi Bahra
When I want to serialise a vector of shared ptrs to concrete types, there are no warnings on gcc/Linux. and program runs correctly. However when I compile on HP-UX, I get the following:
.../boost_1_39_0/boost/serialization/export.hpp", line 137: warning #2414-D: delete of pointer to incomplete class BOOST_STATIC_WARNING(boost::is_polymorphic<T>::value); ....
It appears that boost shared ptr serialisation has made the assumption that the pointer must be polymorphic! Is this assumption correct ? i.e are we allowed to serialize shared ptrs to concrete types ?
To get rid of the message I simply add a virtual member function.
It appears in this case that HPUX compiler is more accurate, and I don't understand why this same warning does not appear with gcc.
For note to everyone in this thread, I had (and reported a few months back) the *exact* same problem, fixed by adding a single unused virtual function in the concrete class, on Visual Studio 8.
participants (3)
-
Avi Bahra
-
OvermindDL1
-
Robert Ramey