On 19/01/2024 21.03, Chris Lamb wrote:
Was there any reason to reject >ULONG_MAX? I'm touching this code,
and don't see a reason for it; it looks very arbitrary; especially
since some systems can have 32-bit long, but 64-bit time_t. Should I
just drop that check, or keep it? And why?

There is another issue with the ULONG_MAX - that is it allows to represent timestamps up to 2106, but a 32-bit time_t is a signed int32, so will roll over in 2038 back to 1901.

At some (not too far) point in time, programs and libraries compiling with glibc should start to build with -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 to get 64-bit time_t everywhere. [1]

Ciao
Bernhard M.

[1] https://www.reddit.com/r/linux/comments/19a95cl/today_is_y2k38_commemoration_day_t14/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to