[cxx-abi-dev] Passing non-trivial types through ...

John McCall rjmccall at apple.com
Wed Aug 20 21:55:54 UTC 2014


On Aug 20, 2014, at 1:57 PM, Jason Merrill <jason at redhat.com> wrote:
> On 08/13/2014 08:36 PM, Jason Merrill wrote:
>>>> From: John McCall <rjmccall at apple.com>
>>>> This is clearly the right way for any vendor who wants to accept non-POD
>>>> variadic arguments to do it:  no solution involving memcpy can be
>>>> correct for all types
>> 
>> Yep.  The only question is whether it's better, for code that is in a
>> gray area of the standard, to stick with the broken historical practice
>> or do something more correct.
> 
> Any more opinions on this question?  I'm ambivalent.
> 
> Since there is incompatible existing practice and the code is only conditionally-supported anyway, perhaps sticking with existing practice is the right answer even though it breaks the object model.
> 
> On the other hand, perhaps since the code is only conditionally-supported, compatibility with existing practice isn't as important.

I’m not sure we really do have “existing practice” on this.  Dennis, I
apologize if I’m misunderstanding you, but it sounds like you consider
this to be undefined behavior (which is an allowed interpretation — in fact,
that was the explicit wording prior to C++11) and hence do not feel like
you’ve made a promise to support users relying on aCC’s current
behavior.  In that case, we can adopt Jason’s proposal, and aCC can
freely choose whether to continue its current practice indefinitely
(since how they implement undefined behavior is their own business)
or move to Jason's proposed rule (since doing so wouldn't break
compatibility with well-defined programs).

John.


More information about the cxx-abi-dev mailing list