Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C wish list Date: Tue, 26 Mar 2019 13:43:30 -0700 Organization: None to speak of Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="c13712a869cda6719703ae7ae7c66b4a"; logging-data="4346"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18A2Ud2caoCOEZttJ1UL2oJ" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:GWEIRWYGYSQVUdGbtndBr8fspq4= sha1:NMhNxRldjHWX5tcofk7XiIsC93g= Xref: csiph.com comp.lang.c:142490 scott@slp53.sl.home (Scott Lurndal) writes: > Keith Thompson writes: [...] >>The obvious solution (for UNIX-like systems, at least) is to make >>time_t a signed 64-bit integer, even on 32-bit systems. > > It may seem obvious, but it likely would have performance implications > given the frequency (pun intended) of time_t usage in the kernel. > Better to just go with 64-bit UNIX{-like} systems now, which most > people have already done. I suggest it's worth gathering more information. My Android phone, for example, is a 32-bit system with as Linux kernel, and I've recently worked on embedded 32-bit Linux-based systems. Maybe abandoning all such systems for 64-bit before 2038 will make sense, but not *just* for the sake of time_t. If the kernel uses time_t a lot internally, I wonder if it would make sense to add, say, a kernel-only time32_t type (with an epoch of, say, 2020-01-101) and converting between that and the 64-bit time_t as needed, by adding or subtracting 1577836800. (Admittedly, that could be a lot of work.) This assumes that the kernel never needs to deal with times before 1951-12-13, 2**31 seconds before 2020-01-01. The question is whether 32-bit systems will still make sense in 2038 -- and I doubt that anyone knows the answer to that. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */