[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [MAJOR BUG] g++ 2.95.x generates invalid code for KDE 3.3.0
From: Thiago Macieira <thiago.macieira () kdemail ! net>
Date: 2004-09-19 15:51:50
Message-ID: 200409191251.58639.thiago.macieira () kdemail ! net
[Download RAW message or body]
Guillaume Laurent wrote:
>On Sunday 19 September 2004 15:24, Thiago Macieira wrote:
>> - a constructor for one of the classes inheriting the virtual base calls
>> one function which in turn calls an overridden virtual function
>
>Virtual functions do not work in ctors in general.
They work fine in g++ 3.3/3.4 and there's nothing in the standard that
prevents us from doing that.
The problem you're alluding to is that people expect constructors to call
the overriden functions in more-derived classes. That isn't supported by
the standard: both g++ 2.95 and the 3.x series work correctly. Calls to
virtual functions inside a constructor are not virtual at all.
The problem in this case is that a virtual function is called *indirectly*
from inside the constructor: the constructor calls a function which in turn
calls the virtual function.
Leo Savernik wrote:
>Why discouraged? This is the very first gross bug that I've ever
>encountered with 2.95
Exactly. So there's a major bug. Therefore, it's people using it that should
properly fix their compilers, not us working around the bugs.
g++ 2.95.4 on Linux is known now to produce invalid code. It should no
longer be used. As a compromise till people upgrade their compilers (to a
2.95.5, for instance, if that ever comes along), we should provide code
that doesn't trigger the bug for a while, but not for long.
As for its use on other platforms, I said "not supported" meaning that the
user's problem of making it work, not ours.
--
Thiago Macieira - Registered Linux user #65028
thiago (AT) macieira (DOT) info
ICQ UIN: 1967141 PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
[Attachment #3 (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic