unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: Time not representable
Date: Sat, 12 Mar 2011 22:13:28 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110312T230903-355@post.gmane.org> (raw)
In-Reply-To: 4D7A5FE1.5000400@cs.ucla.edu

Paul Eggert <eggert <at> cs.ucla.edu> writes:

> 
> On 03/11/2011 05:01 AM, Carsten Dominik wrote:
> > Why is it that these things are different on different systems?  Is
> > this under the control of Emacs, or does this depend on system
> > libraries which are being used?
> 
> Both.
> 
> Time stamps on most modern systems have nanosecond resolution,
> but Emacs's internal time stamps only use microsecond resolution.
> This means (for example) that Emacs cannot determine that
> one file is newer than another, even when it is newer.
> This bug really should get fixed at some point.
> 
> In addition to resolution problems, there are also the
> range problems that you alluded to.  time_t is usually
> a signed 32-bit or 64-bit integer; a few systems use unsigned
> integers, and several use signed integers but do not allow
> negative values.  (Emacs in theory could use 32-bit EMACS_INT
> internally on a system with 64-bit time_t, but I expect that
> combination is rare.)
> 
> You have to be careful about inferring ranges from behavior,
> though, because when Emacs converts times, it sometimes doesn't check
> for overflow.  This means you can get undefined behavior if you use
> time stamps that cannot be represented internally.
> For example, (encode-time 0 0 0 1 1 1152921504606846976)
> returns the obviously-bogus value (-948597 62170)
> on my RHEL 5.5 x86-64 host, whereas it correctly reports
> a "Specified time is not representable" error on
> my Ubuntu 10.10 x86 host.  This is a bug that should get
> fixed at some point too, though I expect it's less important
> in practice than the nanosecond-resolution bug.


Hi Paul (and Andreas)

thanks for the information.  So if a system uses a signed
64 bit integer, then the representation problems will be
fixed automatically, without further changes in Emacs?
This does sound hopeful!  Is there anyone here who has
a 64 bit system and con confirm that encode-time can
handle times both before 1970 and after 2040 without
any problems?

- Carsten




  reply	other threads:[~2011-03-12 22:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 13:01 Time not representable Carsten Dominik
2011-03-11 13:19 ` Andreas Schwab
2011-03-11 17:46 ` Paul Eggert
2011-03-12 22:13   ` Carsten Dominik [this message]
2011-03-12 23:22     ` Paul Eggert
2011-03-13  7:05     ` Paul Eggert
2011-03-13 17:52       ` Eli Zaretskii
2011-03-14 16:57       ` carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20110312T230903-355@post.gmane.org \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).