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: [PATCH v2 3/7] y2038: Provide conversion helpers for struct __timespec64


On Thu, 2 May 2019, Lukasz Majewski wrote:

> As we discussed in the other thread - kernel relies on "implementation
> depended" behaviour from GCC (which is now to discard higher 32 bits
> from tv_nsec [1]).

The kernel and glibc use a common-usage profile of C, which defines 
conversion of integer types to narrower integer types as modulo.  We do 
not need to be concerned about strange implementations making other 
choices for such conversions; they are not relevant for building the 
kernel.  (This is a separate matter from undefined behavior for signed 
arithmetic overflow.)

In the current draft of the next C++ standard revision, this is required 
for C++, and it's entirely plausible that C will follow at some point.

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