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: [RFC 2/7] y2038: Provide conversion helpers for struct __timespec64


On Wed, 27 Mar 2019, Lukasz Majewski wrote:

> Those functions allow easy conversion between Y2038 safe struct __timespec64
> and other time related data structures.

Please include a detailed comment explaining whether these functions are 
relevant (but trivial) in the case where the default time_t is 32-bit.  
If not, they shouldn't be compiled in that case.

> +/* Check if a value lies with the valid nanoseconds range.  */
> +#define IS_VALID_NANOSECONDS(ns) (ns >= 0 && ns <= 999999999)

Surround macro arguments with parentheses so arbitrary expressions are 
valid.

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