C++ vtable ordering

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

We have introduced a new virtual function in between existing virtual functions in a Class definition. This is compiled into a library. Usually this library needs to be backward compatible.
The programs that use this library fail if they are not recompiled, even though they do not make use of this new virtual function. These programs do not derive from the Class, they just link to the library.

Is this because of "The order of the virtual function pointers in a virtual table is the order of declaration of the corresponding member functions in the class."( Itanium C++ ABI)

Now if that virtual function is moved at the end without disturbing the ordering of existing virtual functions, then the library tends to be backward compatible(not sure). The programs work with the latest library even without recompilation. So is this fix correct? Or are there any risks involved?

Regards,
Rohini





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux