This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: conformtest: Add x32 XFAILs for mq_attr element types (bug 21279) [committed]


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.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]