Re: [PATCH v2 2/2] timegm.3: Remove recommendation against use of timegm()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/4/21 17:47, Alejandro Colomar (man-pages) wrote:
Since C2X will add timegm(3), it's good news.

Yes at that point we can remove or reword the portability warning.


the following restriction could be added without altering the behavior of any existing program:

[
If any of the fields of 'struct tm' would overflow 'int32_t', the behavior of timegm(3) is undefined.
]

No, timegm should not be documented to have a 32-bit limit on struct tm components. It should be documented only to have an int limit on struct tm components. I.e., the same as mktime, localtime, gmtime, etc.


It would simplify very much glibc code, by imposing small restrictions to the user.

The general glibc philosophy is to not impose arbitrary limits on the user, even if the limits are "small restrictions". Occasionally limits need to be imposed anyway for a good reason, but there's no good reason here.



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux