From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Eggert Subject: Re: bug#27736: OSX 10.6.8: Building from master branch fails. Date: Wed, 28 Mar 2018 15:08:03 -0700 Message-ID: <685168ca-d136-89d7-f33b-0158f094c9ba@cs.ucla.edu> References: <46d25462-4eb0-0bd0-f5ab-2b28bae98ee6@cs.ucla.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------92D96E1B6E320320A2D74AE3" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f1JEq-0005d5-1B for emacs-orgmode@gnu.org; Wed, 28 Mar 2018 18:08:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f1JEk-0006Kt-W6 for emacs-orgmode@gnu.org; Wed, 28 Mar 2018 18:08:12 -0400 In-Reply-To: Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Glenn Morris Cc: 27736@debbugs.gnu.org, Keith David Bershatsky , "Charles A. Roelli" , emacs-org list , Noam Postavsky This is a multi-part message in MIME format. --------------92D96E1B6E320320A2D74AE3 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 03/28/2018 12:33 PM, Paul Eggert wrote: > Unfortunately the new org code contains the expression (encode-time 0 > 0 0 0 0 -50000), which won't work on Emacs platforms where time_t is > 32 bits or is unsigned, since such platforms cannot represent a time_t > value corresponding to the year -50000. I installed the attached patch into Emacs master to try to fix this. I'll CC: this to emacs-orgmode in the hopes that this won't get lost in the next merge to Emacs master. --------------92D96E1B6E320320A2D74AE3 Content-Type: text/x-patch; name="0001-Port-recent-org-clock-fix-to-POSIX-time_t.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Port-recent-org-clock-fix-to-POSIX-time_t.patch" >From 43994e484fadac28682542e75548e80cbb80987d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 28 Mar 2018 15:03:40 -0700 Subject: [PATCH] Port recent org-clock fix to POSIX time_t * lisp/org/org-clock.el (org-clock-special-range): Don't assume support for time_t values less than 0, or less than -2**31 for that matter (Bug#27736). --- lisp/org/org-clock.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index ff32e28d1e..9be0d5bc1f 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el @@ -2239,8 +2239,18 @@ org-clock-special-range (let* ((start (pcase key (`interactive (org-read-date nil t nil "Range start? ")) ;; In theory, all clocks started after the dawn of - ;; humanity. - (`untilnow (encode-time 0 0 0 0 0 -50000)) + ;; humanity. However, the platform's clock + ;; support might not go back that far. Choose the + ;; POSIX timestamp -2**41 (approximately 68,000 + ;; BCE) if that works, otherwise -2**31 (1901) if + ;; that works, otherwise 0 (1970). Going back + ;; billions of years would loop forever on Mac OS + ;; X 10.6 with Emacs 26 and earlier (Bug#27736). + (`untilnow + (let ((old 0)) + (dolist (older '((-32768 0) (-33554432 0)) old) + (when (ignore-errors (decode-time older)) + (setq old older))))) (_ (encode-time 0 m h d month y)))) (end (pcase key (`interactive (org-read-date nil t nil "Range end? ")) -- 2.14.3 --------------92D96E1B6E320320A2D74AE3--