Actions

icon Post
text/html Subscribe
text/html Unsubscribe

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

Re: [cxx-abi-dev] non-public non-static members vs POD layout


  • To: David Vandevoorde <daveed@xxxxxxx>
  • Subject: Re: [cxx-abi-dev] non-public non-static members vs POD layout
  • From: Mark Mitchell <mark@xxxxxxxxxxxxxxxx>
  • Date: Tue, 29 Apr 2008 08:28:48 -0700

David Vandevoorde wrote:

Also since the ABI predates TC1, the inclusion of pointers to members on PODs should not apply. I suppose the spec would explicitly say "PODs as defined prior to TC1"

Does anyone object to making that change?

I think so. Hereunder is an e-mail to this list (from a few years ago) that seems to indicate we already agreed to use the TC1 definition of PODs.

Well, that's embarassing; clearly my memory is pathetic.

So, yes, we agreed to use TC1 PODs, and thus pointers-to-members are in. In that case, yes, I think we have to say how they are laid out -- but I think we already do.

For data members, we say that a pointer to data member is "represented as a ptrdiff_t."

And for pointers to function members; we say that they have "the size, data size, and alignment of a class containing these two members", after saying what members they are. I think we could probably make that more explicit by saying that they layout is as for the following class:

  struct pointer_to_member {
    void (*ptr)();
    ptrdiff_t adj;
  };

That would eliminate ambiguities. But, I think that's just an editorial change. (Anyone object to that change? Or think it's a good idea?)

Thoughts?

--
Mark Mitchell
CodeSourcery
mark@xxxxxxxxxxxxxxxx
(650) 331-3385 x713