[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs current-time-string core dump on 64-bit hosts
From: |
Paul Eggert |
Subject: |
Re: Emacs current-time-string core dump on 64-bit hosts |
Date: |
Fri, 24 Mar 2006 13:00:15 -0800 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
Richard Stallman <rms@gnu.org> writes:
> > I think it is possible, even trivial, to fix ctime. The largest year
> > value that can be represented in a 64-bit time-value is around 1
> > trillion, and that will fit in 12 digits. Isn't this trivial to fix?
>
> No, because ctime is implemented in terms of localtime, localtime is
> defined to use an 'int' to represent the year, and 'int' is only 32
> bits on most hosts.
>
> I do not follow you. If conversion to `int' truncates the year, that
> can cause incorrect results, but it can't cause the results to be any
> further out of range. The year in `ctime' will still fit in 12 digits.
True.
I had interpreted "fix ctime" to mean "ctime must always return a
string that contains the correct year, month, day, etc., assuming the
Gregorian calendar with no leap seconds". But by "fix ctime" you
merely meant "ctime must never crash". In that case, yes, a fix is
trivial, and the GNU C library's ctime implementation already does
that: its ctime always returns NULL (setting errno) with out-of-range
inputs.
- Re: Emacs current-time-string core dump on 64-bit hosts, (continued)
- Re: Emacs current-time-string core dump on 64-bit hosts, Eli Zaretskii, 2006/03/30
- Re: Emacs current-time-string core dump on 64-bit hosts, Richard Stallman, 2006/03/20
- Re: Emacs current-time-string core dump on 64-bit hosts, Paul Eggert, 2006/03/25
- Re: Emacs current-time-string core dump on 64-bit hosts, Eli Zaretskii, 2006/03/25
- Re: Emacs current-time-string core dump on 64-bit hosts, Paul Eggert, 2006/03/26
- Re: Emacs current-time-string core dump on 64-bit hosts, Eli Zaretskii, 2006/03/26
- Re: Emacs current-time-string core dump on 64-bit hosts, Richard Stallman, 2006/03/27
- Re: Emacs current-time-string core dump on 64-bit hosts, Eli Zaretskii, 2006/03/28
- Re: Emacs current-time-string core dump on 64-bit hosts, Richard Stallman, 2006/03/29
- Re: Emacs current-time-string core dump on 64-bit hosts, Richard Stallman, 2006/03/27
- Re: Emacs current-time-string core dump on 64-bit hosts,
Paul Eggert <=
- Re: Emacs current-time-string core dump on 64-bit hosts, Paul Eggert, 2006/03/25
- Re: Emacs current-time-string core dump on 64-bit hosts, Richard Stallman, 2006/03/27
- Re: Emacs current-time-string core dump on 64-bit hosts, Paul Eggert, 2006/03/26
- Message not available
- Re: Emacs current-time-string core dump on 64-bit hosts, Paul Eggert, 2006/03/28
- Re: Emacs current-time-string core dump on 64-bit hosts, Richard Stallman, 2006/03/28
- Re: Emacs current-time-string core dump on 64-bit hosts, Paul Eggert, 2006/03/30
- Re: Emacs current-time-string core dump on 64-bit hosts, Richard Stallman, 2006/03/31
Re: Emacs current-time-string core dump on 64-bit hosts, Andreas Schwab, 2006/03/17
Emacs current-time-string core dump on 64-bit hosts, Paul Eggert, 2006/03/17