[PATCH v2 1/2] Y2038: Add 64-bit time for all architectures

Paul Eggert eggert@cs.ucla.edu
Thu Jun 14 16:56:00 GMT 2018


On 06/14/2018 06:51 AM, Albert ARIBAUD (3ADEV) wrote:
> +/* check whether a time64_t value fits in a time_t */
> +# if __TIMESIZE == 64
> +/* __time64_t is time_t, so it always fits_in_time_t */
> +#  define fits_in_time_t(x)	1
> +# else
> +/* Not all __time64_t values can fit; check by type-casting */
> +static inline bool
> +fits_in_time_t (__time64_t t)
> +{
> +  return t == (time_t) t;
> +}
> +# endif

Don't bother with the "#if". Just have the static function 
unconditionally. It should generate zero instructions if time_t is 64 bits.



More information about the Libc-alpha mailing list