[Development] QtMultimedia BIC / header cleanliness issue
Thiago Macieira
thiago.macieira at intel.com
Mon Dec 24 18:35:25 CET 2012
On segunda-feira, 24 de dezembro de 2012 06.30.58, Sascha Cunz wrote:
> > Adding a new virtual implies changing the layout of the virtual table. If
> > we append the virtual, the order of the existing virtuals should not
> > change, so the calls should still make through.
>
> Given the two classes:
>
> class A {
> public: virtual void a();
> };
>
> class B : public A {
> public: virtual void b();
> };
>
> You're effectively saying here that adding a virtual to A doesn't change the
> v-table layout of A (which by itself is right), but it implicitly changes
> the v-table layout of B (B::b()'s address-slot moves one slot behind).
Correct.
> > Since the virtual destructor is missing, one can assume that objects of
> > those classes are never deleted through those specific classes anyway.
> > Moreover, it seems that those classes are often used in multiple
> > inheritance and are not in the primary inheritance path. That means the
> > addition of virtuals will not change the primary virtual table.
>
> What is the effect to:
>
> class UserClass : public QObject, WhereVTableWouldBeExpanded,
> AnotherInterface {}
>
> I think to remember to see that compilers produce code that expects the
> vtable of subobjects at a fixed offset from the beginning of the overall
> vtable.
Correct too.
> But strictly spoken, I would rather say no: BC is BC no matter what silly
> mistakes it includes (I have actually had to deal with code that used the
> above mentioned inheritance layouts).
> OTOH, it's still very early in the life of released Qt5.
We can change the soname for the library. libQt5Multimedia.so.6.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121224/1cac8b67/attachment.sig>
More information about the Development
mailing list