This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: KDE hackers, please read (was [nathan@codesourcery.com: Re: GCC3.0.3: Bugs to Fix]) (fwd)
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: Lubos Lunak <l dot lunak at sh dot cvut dot cz>, "kde-core-devel at mail dot kde dot org" <kde-core-devel at mail dot kde dot org>, Joe Buck <jbuck at synopsys dot com>, Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 11 Dec 2001 09:11:57 -0800
- Subject: Re: KDE hackers, please read (was [nathan@codesourcery.com: Re: GCC3.0.3: Bugs to Fix]) (fwd)
--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