KDE hackers, please read (was [nathan@codesourcery.com: Re: GCC 3.0.3: Bugs to Fix]) (fwd)
Mark Mitchell
mark@codesourcery.com
Tue Dec 11 09:28:00 GMT 2001
--On Tuesday, December 11, 2001 03:09:53 PM -0200 Alexandre Oliva
<aoliva@redhat.com> wrote:
> On Dec 10, 2001, Mark Mitchell <mark@codesourcery.com> wrote:
>
>>> 3) Persuade gcc folks to add compiler switch that makes gcc use string
>>> comparing when doing rtti, and simply compile whole KDE with this switch
>>> turned on.
>
>> All code in the application -- including the C++ run-time library --
>> needs to be compiled the same way, so you would have to rebuild
>> everything to do this.
>
> Err... Wouldn't it be enough to link with a modified version of the
> object file that implements rtti comparison? Or are such comparisons
> ever inlined in the generated code?
They are typically inlined. From <typeinfo>:
class type_info {
...
bool operator==(const type_info& __arg) const
{ return __name == __arg.__name; }
};
There you have it. We certainly want to inline these; they are
almost free.
The point I tried to make yesterday, but apparently somewhat
unsuccessfully, is that RTTI is only the tip of the iceberg.
You might be able to fix this -- but you can't fix all the
problems, and it's not easy to specify what subset of the
language you can support.
It's a mistake to try. It's much better to tell your customers
how to use your product successfully than to encourage them to
use a technique likely to fail.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the Gcc
mailing list