Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2007-05-10 11:47:33


test_no_rtti is somewhat mis-named. It really tests whether
two different extended type info systems can inter-operate
as intended. In order to write this test, I need a second one
so I made one based on the "exported" identfier. I used
that to test / demo that different types with different
extended type info systems could inter-operate and it
demonstrates that. To run the test, it DOES require
that it e compiled with runtime typing.

I added this facility as sort of an after thought - of course
everything has unseen consequences. So what is really
needed is a real effort to verify and perhaps tweak the
library to support a different default extended type info
system. This would entail.

a) Defining an alternative system - such as one based on
assigned external names - like "export" does. Or a
whole new idea - perhaps based on the recent boost
GUID.
b) Adding a short explanation to the extended type info section
of the documentation
c) making a specific test for the new extended type info
system.
d) Running most or all of the serialization tests with this
new extended type info type.

If one has a lot of time on his hands, he could also add
a couple of new functions to extended type info - like
construction of a new instance given the "external type identifier"
in order to make a poor man's COM or CORBA (C++ only)
equivalent. But of course that's much more ambituous

Sorry I can't offer a complete solution.

Robert Ramey

Ng Pan wrote:
> Hi
>
> Background: 1_33_1
> Example : boost_1_33_1\libs\serialization\vc6ide\test_no_rtti
>
> I can run the example successfully on Debug mode with no warning and
> no error.
>
> However, it has several warnings, abnormal operation and memory leak
> when running on release mode.
>
> The following is the warnings:
>
>
>
> d:\barr\serialization\boost\boost_1_33_1_bk\boost\smart_cast.hpp(200):
> warning C4541: 'dynamic_cast' used on polymorphic type
> 'polymorphic_base' with /GR-; unpredictable behavior may result
> d:\barr\serialization\boost\boost_1_33_1_bk\boost\smart_cast.hpp(200):
> warning C4541: 'dynamic_cast' used on polymorphic type
> 'polymorphic_base' with /GR-; unpredictable behavior may result
> ..\..\..\boost\smart_cast.hpp(230) : see reference to function
> template instantiation 'T
> boost::smart_cast_impl::pointer<T>::polymorphic::cast(const U *)'
> being compiled
> with
> [
> T=const polymorphic_derived2 *,
> U=type
> ]
> ..\..\..\boost\smart_cast.hpp(286) : see reference to function
> template instantiation 'T
> boost::smart_cast_impl::pointer<T>::cast(const U *)' being compiled
> with
> [
> T=const polymorphic_derived2 *,
> U=type
> ]
> ..\..\..\boost\serialization\void_cast.hpp(136) : see
> reference to function template instantiation 'T
> boost::smart_cast<polymorphic_derived2 const *,polymorphic_base const
> *>(U)' being compiled with
> [
> T=const polymorphic_derived2 *,
> U=const type *
> ]
> ..\..\..\boost\serialization\void_cast.hpp(133) : while
> compiling class-template member function 'const void
> *boost::serialization::void_cast_detail::void_caster_primitive<Derived,Base>::downcast(const
> void *) const'
> with
> [
> Derived=const polymorphic_derived2,
> Base=const type
> ]
> ..\..\..\boost\serialization\void_cast.hpp(191) : see
> reference to class template instantiation
> 'boost::serialization::void_cast_detail::void_caster_primitive<Derived,Base>'
> being compiled
> with
> [
> Derived=const polymorphic_derived2,
> Base=const type
> ]
> ..\..\..\boost\serialization\base_object.hpp(107) : see
> reference to function template instantiation 'const
> boost::serialization::void_cast_detail::void_caster
> &boost::serialization::void_cast_register(const Derived *,const type
> *)' being compiled
> with
> [
> Derived=polymorphic_derived2
> ]
> ..\..\..\boost\serialization\base_object.hpp(103) : while
> compiling class
> d:\barr\serialization\boost\boost_1_33_1_bk\boost\serialization\extended_type_info_typeid.hpp(92):
> warning C4541: 'typeid' used on polymorphic type
> 'polymorphic_derived2' with /GR-; unpredictable behavior may result
>
>
>
>
> Then the following is the console output after invoking the release
> exe file:
>
> Running 1 test case...
> unknown location(0): fatal error in "test_main_caller( argc, argv )":
> std::bad_typeid: Bad read pointer - no RTTI data!
>
> *** errors detected in test suite "Test Program"; see standard output
> for details
> Detected memory leaks!
> Dumping objects ->
> {263} normal block at 0x00983EA8, 4 bytes long.
> Data: <D E > 44 D1 45 00
> Object dump complete.
>
>
> What should I do to make the release mode run correctly?
>
> Best regards
> Barr Ng
>
> _________________________________________________________________
> Learn English via Shopping Game, FREE!
> http://www.linguaphonenet.com/BannerTrack.asp?EMSCode=MSN06-03ETFJ-0211E


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