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:

> > 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?

*Avoiding* explicit conversion code might require language features.  
*Writing* such code certainly shouldn't; it's just two integer assignments 
to copy values from a structure that represents the sender's struct 
timespec, to one that represents the receiver's struct timespec.  (When 
sending to less-privileged code you should also explicitly zero any 
padding on the receiving side.)

-- 
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]