Sujet : Re: Y2K38 bug (January 19, 2038)
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.awkDate : 11. Mar 2024, 19:40:09
Autres entêtes
Organisation : None to speak of
Message-ID : <87edcga9yu.fsf@nosuchdomain.example.com>
References : 1 2 3 4
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
"Mr. Man-wai Chang" <
toylet.toylet@gmail.com> writes:
On 9/3/2024 3:51 am, Keith Thompson wrote:
I'm a little disappointed that POSIX doesn't require time_t to be
signed. 64 bits is enough to represent a range of about 584 billion
years. An unsigned time_t makes it impossible to represent times before
1970.
>
Could we roll our own signed time_t? :)
I see the smiley, but I don't get the joke.
If you're creating your own implementation, you can do anything you
like. If not, and you're using an implementation that makes time_t an
unsigned type, there's not much you can do to treat it as signed. For
example, localtime() would presumably treat a time_t value of -2 as a
very large unsigned value.
I don't know of any implementations that make time_t an unsigned type.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comWorking, but not speaking, for Medtronicvoid Void(void) { Void(); } /* The recursive call of the void */