This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ vtable ordering


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]