This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 3/7] y2038: Provide conversion helpers for struct __timespec64
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Lukasz Majewski <lukma at denx dot de>
- Cc: Stepan Golosunov <stepan at golosunov dot pp dot ru>, Paul Eggert <eggert at cs dot ucla dot edu>, <libc-alpha at sourceware dot org>, Arnd Bergmann <arnd at arndb dot de>
- Date: Thu, 2 May 2019 15:59:39 +0000
- Subject: Re: [PATCH v2 3/7] y2038: Provide conversion helpers for struct __timespec64
- References: <20190414220841.20243-1-lukma@denx.de> <20190429104613.16209-1-lukma@denx.de> <20190429104613.16209-4-lukma@denx.de> <20190502115651.heosciboqqw7xobj@sghpc.golosunov.pp.ru> <20190502161735.68d13cbd@jawa>
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