Tail padding, again

Mark Mitchell mark at codesourcery.com
Sun Nov 5 08:28:15 UTC 2000


>>>>> "Jim" == Jim Dehnert <dehnert at baalbek.engr.sgi.com> writes:

    Jim> My understanding is that the Compaq compiler released in the
    Jim> summer implemented the data model.  The original request for
    Jim> this overlaying came from HP.  Perhaps they would like to
    Jim> comment.

David Gross will probably jump in, but suffice it to say that HP's
back-end team thinks this is very hard.

    Jim> Again, POD data (C structs) has align=nvalign, and
    Jim> size=nvsize=dsize.  We do NOT put other members in POD
    Jim> padding, for the reasons you mention.  As far as I can tell,
    Jim> C structs will be laid out exactly the same in C++ as in C,
    Jim> and C copying (memcpy) will work fine for them.  That
    Jim> certainly was the intent.

    Jim> Are you overlooking this, or am I missing something?

The point is that C++ programmers often make C++ objects that have the
same data members as C structs, but are not PODs.  Breaking that
layout equivalence is very odd indeed.

--
Mark Mitchell                   mark at codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com




More information about the cxx-abi-dev mailing list