From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#11825: 24.1.50; float-time no longer accepts negative time values Date: Mon, 09 Jul 2012 05:56:21 +0300 Message-ID: <83fw91lk16.fsf@gnu.org> References: <4FF79ADD.8080601@cs.ucla.edu> <83r4so12ja.fsf@gnu.org> <4FF89C4C.6060503@cs.ucla.edu> <83wr2fklhs.fsf@gnu.org> <4FF93637.6060304@cs.ucla.edu> <4FFA11CB.8000502@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1341802620 1223 80.91.229.3 (9 Jul 2012 02:57:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 9 Jul 2012 02:57:00 +0000 (UTC) Cc: 11825@debbugs.gnu.org, schwab@linux-m68k.org To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 09 04:57:00 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1So49g-0007Xq-Qn for geb-bug-gnu-emacs@m.gmane.org; Mon, 09 Jul 2012 04:56:56 +0200 Original-Received: from localhost ([::1]:43806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1So49f-0006xd-Nn for geb-bug-gnu-emacs@m.gmane.org; Sun, 08 Jul 2012 22:56:55 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1So49c-0006x4-J3 for bug-gnu-emacs@gnu.org; Sun, 08 Jul 2012 22:56:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1So49a-0003rq-TX for bug-gnu-emacs@gnu.org; Sun, 08 Jul 2012 22:56:52 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1So49a-0003ri-QD for bug-gnu-emacs@gnu.org; Sun, 08 Jul 2012 22:56:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1So4Ec-0002RG-OC for bug-gnu-emacs@gnu.org; Sun, 08 Jul 2012 23:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Jul 2012 03:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11825 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11825-submit@debbugs.gnu.org id=B11825.13418029099355 (code B ref 11825); Mon, 09 Jul 2012 03:02:02 +0000 Original-Received: (at 11825) by debbugs.gnu.org; 9 Jul 2012 03:01:49 +0000 Original-Received: from localhost ([127.0.0.1]:57185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1So4EO-0002Qp-O0 for submit@debbugs.gnu.org; Sun, 08 Jul 2012 23:01:49 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:39375) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1So4EM-0002Qh-3z for 11825@debbugs.gnu.org; Sun, 08 Jul 2012 23:01:47 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0M6V00H00HASE700@a-mtaout21.012.net.il> for 11825@debbugs.gnu.org; Mon, 09 Jul 2012 05:56:31 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M6V00HW5HI79L40@a-mtaout21.012.net.il>; Mon, 09 Jul 2012 05:56:31 +0300 (IDT) In-reply-to: <4FFA11CB.8000502@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61740 Archived-At: > Date: Sun, 08 Jul 2012 16:03:39 -0700 > From: Paul Eggert > CC: Eli Zaretskii , 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.