[Development] Is overriding an existing virtual method 'BC' in Qt 4?
Marc Mutz
marc.mutz at kdab.com
Tue Oct 9 18:19:19 CEST 2012
On Tuesday October 9 2012, Knoll Lars wrote:
> On Oct 9, 2012, at 12:31 PM, Marc Mutz <marc.mutz at kdab.com> wrote:
> > On Wednesday September 26 2012, Thiago Macieira wrote:
> >> But note that there's one stricter requirement: the forwards
> >> compatibility that applies within a patch series. Adding this new
> >> virtual within the same patch series means a new, public symbol, which
> >> could get used in applications.
> >
> > What about forward-compatibility if I'm changing a pure-virtual to a mere
> > virtual function? AFAIU, pure virtual functions are actually backed by a
> > function that prints "pure virtual called" and the aborts. So adding a
> > (different) implementation should be ok, even in a patch release[1]?
>
> It would still break forward compatibility. Assume you do the change in
> 5.0.1, and an app gets compiled against 5.0.1 using the new symbol (by not
> reimplementing it in a derived class, or explicitly calling it). Your app
> would crash when run against 5.0.0.
Ok, so a pure virtual doesn't create a symbol. Understood.
Now, what's the forward-compatibility policy on the 4.8 branch?
Thanks,
Marc
--
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
More information about the Development
mailing list