This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: conformtest: Add x32 XFAILs for mq_attr element types (bug 21279) [committed]
On Thu, Mar 23, 2017 at 5:25 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 23 Mar 2017, Zack Weinberg wrote:
>
>> For clarity, my position is that it is ALWAYS a design error for a
>> field of a structure in a C-based API spec to be given a bare
>> fundamental type. Such structures always wind up needing to be passed
>> across an ABI discontinuity sooner or later, and you can't be sure you
>> are allowed to copy them, so you must instead make it possible for
>> caller and callee to align, and typedefs are the tool C provides to do
>> that. The value range is not relevant.
>
> And my view is that while it might be preferably to use typedefs for new
> structures, use of bare types is not problem in an existing API unless the
> range is inadequate, and that it's not realistic to expect to pass
> structures with either typedefs (other than intN_t / uintN_t) or bare
> "long" types across an ABI discontinuity without explicit conversion code
> on at least one side that knows about the different ABIs.
That's very clear, thank you.
It is my assessment that, for the specific case of tv_nsec on ILP32
platforms where time_t is 64 bits wide, explicit conversion code would
only be viable with additional language features that no one has even
tried to design let alone implement, such as a way to force padding
bits to be maintained as zero by the compiler. Can you explain why
you disagree with this assessment?
zw