In another thread, Warren wrote:
> It's unfortunate that the ABI breaks so easily with C++. With C,
> there's no problem just adding new functions. But when you add methods
> to a C++ class, it changes the instance size, so it's a different ABI. Wah.
I don't think this is the case. Class member functions just take a
this pointer, just like C functions would take a pointer to a struct.
Now, there is the case of going from a class with only non-virtual member
functoins to a class with virtual members. This increases the instance
size since a vtable is needed.
Changing the number of virtual functions may affect the vtable, but I'm
not familiar with the low level implementation of that. I wouldn't be
surprised if that affected the ABI as well.
But for plain old classes, I don't think C++ is much different from C
in regards to the ABI, as long as member functions are only added, not
removed or changed, and as long as the data members stayed the same.