New g++ ABI

Joe Buck jbuck@synopsys.com
Sat Apr 4 20:05:00 GMT 1998


> I'm thinking about reducing the padding on bases down below the padding
> that fields get, so that the next base is allocated within the padding of
> the previous one: i.e. ...

> Does anyone object to this optimization?  It breaks
> memset (p, 0, sizeof (P)), but that isn't guaranteed to work, and
> will break anyway for empty classes and classes with virtual bases.  But do
> we want to break it for, say, C structs used as bases?

We have to watch out for things like compiler-generated copy constructors
and assignment operators, or STL allocators, doing the equivalent
operation (of writing sizeof(P) bytes though P is a baseclass.  If
we can guarantee that this doesn't happen we're probably OK.

> Warning:  The ABI produced by -fnew-abi may vary from day to day.  Do not
> expect prolonged binary compatibility until I say otherwise.

Depending on timing, it might be a good idea to try to combine all
the new features that may break compatibility, e.g. -fsquangle, into
-fnew-api.







More information about the Gcc mailing list