Re:The perils of transition to 64-bit time_t
by eschaton on Saturday September 28, 2024 @11:26PM
(#41684649)
Since the different sizes are ultimately a platform thing, they need to support multiple variants on those platforms, or limit their support to a new enough base set of APIs that they can rely on 64-bit types being there.
Re:The perils of transition to 64-bit time_t
by _kst_ on Sunday September 29, 2024 @02:55AM
(#41685411)
Code that assumes time_t is the same width as int is already broken, and won't work on typical 64-bit systems were int is 32 bits and time_t is 64 bits.
In any case, I'm not sure I've ever seen any such code.
Re:The perils of transition to 64-bit time_t
by Netch on Monday October 07, 2024 @09:31AM
(#41765826)
> Code that assumes time_t is the same width as int is already broken
You missed the point. It is meant that code _built for the same target_ "assumes" all instances use the same definition of time_t, and not about such a guarantee across different targets. That's why Gentoo solution to redefine target is cumbersome but finally working - as radical as axe.
Yet, somehow the article emphasizes that this is more of a problem for time_t than off_t.
This is believable and it's brobably it's because time_t is more pervasive. Whereas off_t is a POSIX thing involved in a relatively small number of interfaces, time_ t is ISO C and is all over the place.
On top of everything, lots of C code assumes that time_t is an integer type, equal in width to int. A similar assumption for off_t is less common.