all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 11825@debbugs.gnu.org, schwab@linux-m68k.org
Subject: bug#11825: 24.1.50; float-time no longer accepts negative time values
Date: Mon, 09 Jul 2012 05:56:21 +0300	[thread overview]
Message-ID: <83fw91lk16.fsf@gnu.org> (raw)
In-Reply-To: <4FFA11CB.8000502@cs.ucla.edu>

> Date: Sun, 08 Jul 2012 16:03:39 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: Eli Zaretskii <eliz@gnu.org>, 11825@debbugs.gnu.org
> 
> On 07/08/2012 02:00 AM, Andreas Schwab wrote:
> > A difference between two timestamps is always signed.
> 
> No, not if A is an absolute time, and B is a (nonnegative) offset.
> The result is an absolute time, and is unsigned if A was unsigned.
> For example:
> 
>          EMACS_GET_TIME (t);
>          EMACS_SUB_TIME (old, t, EMACS_TIME_FROM_DOUBLE (delay));
> 
> This is a common way that EMACS_SUB_TIME is used in Emacs.

Again, if this facility is limited to this paradigm, I think we should
clearly document that.  The name EMACS_SUB_TIME doesn't tell anything
about that, it certainly sounds like providing a general-purpose
arithmetics on time values.

Anyway, Emacs does subtract absolute time values, at least in Lisp;
see time-subtract.  The current issue started when the result of
time-subtract was passed to float-time, so indirectly such time
differences can sneak into C from Lisp and be handed to these
functions.  And since time-subtract is called by timers, it is very
easy to get into a situation where EMACS_SUB_TIME etc. are used with
second argument not an offset, but an absolute time.

> > this should be prominently explained in systime.h.
> 
> OK, sure, I pushed this:

Thanks.





  parent reply	other threads:[~2012-07-09  2:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-30 16:08 bug#11825: 24.1.50; float-time no longer accepts negative time values Eli Zaretskii
2012-07-03 22:56 ` Glenn Morris
2012-07-07  2:11 ` Paul Eggert
2012-07-07  6:57   ` Eli Zaretskii
2012-07-07 20:30     ` Paul Eggert
2012-07-08  2:57       ` Eli Zaretskii
2012-07-08  7:26         ` Paul Eggert
2012-07-08  9:00           ` Andreas Schwab
2012-07-08 23:03             ` Paul Eggert
2012-07-08 23:37               ` Juanma Barranquero
2012-07-09  0:21                 ` Paul Eggert
2012-07-09  0:57                   ` Juanma Barranquero
2012-07-09  2:56               ` Eli Zaretskii [this message]
2012-07-09  3:33                 ` Paul Eggert
2012-07-08 15:32           ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to=83fw91lk16.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=11825@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=schwab@linux-m68k.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.