From: Markus S. <mar...@gm...> - 2010-04-20 21:21:06
|
On Tue, Apr 20, 2010 at 1:06 PM, Steven R. Loomis <sr...@ic...>wrote: > I can take a look. > > Will this require those linking against ICU to change their flags also? > I think only if they want to use compiler RTTI themselves. Or they may not even need to do it in that case since the library's objects will have RTTI information. They just wouldn't get RTTI information for their own, non-ICU objects. Could we change the internals of our existing RTTI with #ifdefs to either > use 'real' or 'poor' RTTI, i.e. > > … > typedef std::type_info &UClassID > #else > typedef void* UClassID; > … > > … and then autoconf-detect if it works or not? > That should be possible. Pro: We could use real RTTI where available. But Con: We would still have to define the poor man's RTTI methods on new classes, and we could not fully rely on being able to tell if some object is of a certain class *or subclass* because that works with dynamic_cast but not with getDynamicClassID(). PS I did a quick test, and it seems that without -qrtti=all, xlC just always > returns 'true' for > if(typeid(*this)==typeid(other)) > So, perhaps the error is in the test/framework. > Well, that would be bad. The code might compare fields that don't exist because the compiler told it that other is of the same type even if it is of a different type. We might need a test that's run very early in intltest to see if RTTI (whichever form we use) works properly. markus |