[PATCH v2] Always define __USE_TIME_BITS64

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Thu Jan 18 12:15:07 GMT 2024



On 18/01/24 08:51, Andreas Schwab wrote:
> On Jan 18 2024, Adhemerval Zanella wrote:
> 
>> diff --git a/sysdeps/unix/sysv/linux/features-time64.h b/sysdeps/unix/sysv/linux/features-time64.h
>> index dd3442c2ea..ea05271a72 100644
>> --- a/sysdeps/unix/sysv/linux/features-time64.h
>> +++ b/sysdeps/unix/sysv/linux/features-time64.h
>> @@ -24,9 +24,8 @@
>>  # if _TIME_BITS == 64
>>  #  if ! defined (_FILE_OFFSET_BITS) || _FILE_OFFSET_BITS != 64
>>  #   error "_TIME_BITS=64 is allowed only with _FILE_OFFSET_BITS=64"
>> -#  elif __TIMESIZE == 32
>> -#   define __USE_TIME_BITS64	1
>>  #  endif
>> +#  define __USE_TIME_BITS64	1
>>  # elif _TIME_BITS == 32
>>  #  if __TIMESIZE > 32
>>  #   error "_TIME_BITS=32 is not compatible with __TIMESIZE > 32"
>> @@ -34,4 +33,14 @@
>>  # else
>>  #  error Invalid _TIME_BITS value (can only be 32 or 64-bit)
>>  # endif
>> +#else
>> +# if __TIMESIZE == 64
>> +#  define __USE_TIME_BITS64     1
>> +# else
>> +#  define __USE_TIME_BITS64     0
> 
> According to the y2038 docs, __USE_TIME_BITS64 should _only_ be defined
> if time_t is 64-bit wide (and the kernel header follows this by using
> defined(__USE_TIME_BITS64)).  If _TIME_BITS=32 then __USE_TIME_BITS64
> continues to be undefined.
> 

Ack, I will update the patch.


More information about the Libc-alpha mailing list