From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#20862: 25.0.50; 32-bit Emacs configured --with-wide-int miscompiles CL Date: Sat, 27 Jun 2015 11:01:53 -0700 Organization: UCLA Computer Science Department Message-ID: <558EE511.1060609@cs.ucla.edu> References: <558B75FE.3010806@cs.ucla.edu> <83h9pveu87.fsf@gnu.org> <558DAF2C.9050602@cs.ucla.edu> <83h9pucihf.fsf@gnu.org> <558DB9E4.5060501@cs.ucla.edu> <83d20hd3a6.fsf@gnu.org> <558EC7AE.9060801@cs.ucla.edu> <87mvzlun07.fsf@igel.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050304050008020003030002" X-Trace: ger.gmane.org 1435428208 27503 80.91.229.3 (27 Jun 2015 18:03:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Jun 2015 18:03:28 +0000 (UTC) Cc: 20862@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 27 20:03:17 2015 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 1Z8uRb-0004ia-7y for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 20:03:11 +0200 Original-Received: from localhost ([::1]:36406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8uRa-0007Az-Ma for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Jun 2015 14:03:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8uRV-0007AW-Vd for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 14:03:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8uRS-0007fK-M6 for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 14:03:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8uRS-0007fG-Io for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 14:03:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z8uRS-000428-3u for bug-gnu-emacs@gnu.org; Sat, 27 Jun 2015 14:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jun 2015 18:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20862 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20862-submit@debbugs.gnu.org id=B20862.143542812415441 (code B ref 20862); Sat, 27 Jun 2015 18:03:01 +0000 Original-Received: (at 20862) by debbugs.gnu.org; 27 Jun 2015 18:02:04 +0000 Original-Received: from localhost ([127.0.0.1]:59384 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8uQV-00040y-7d for submit@debbugs.gnu.org; Sat, 27 Jun 2015 14:02:03 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:49039) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z8uQT-00040T-3g for 20862@debbugs.gnu.org; Sat, 27 Jun 2015 14:02:02 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 301B9160660; Sat, 27 Jun 2015 11:01:55 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id cmW1ByFGuhhu; Sat, 27 Jun 2015 11:01:54 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3ABF0160848; Sat, 27 Jun 2015 11:01:54 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ZKVZd4sV1DST; Sat, 27 Jun 2015 11:01:54 -0700 (PDT) Original-Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 11A70160660; Sat, 27 Jun 2015 11:01:54 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <87mvzlun07.fsf@igel.home> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:104414 Archived-At: This is a multi-part message in MIME format. --------------050304050008020003030002 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Andreas Schwab wrote: > That isn't true. #: prefixed symbols are uninterned symbols. Good point, thanks. The doc I quoted predates the #: syntax, and evidently wasn't updated when the #: syntax was introduced and used. Since that doc wording is wrong, and there's now no reason to initialize cl--gensym-counter to anything other than 0, I boldly installed the attached patch. It passes 'make bootstrap' and 'make check' (at least, as well as 'make check' did before -- it always fails for me in epg-roundtrip-2). --------------050304050008020003030002 Content-Type: text/x-diff; name="0001-Initialize-cl-gensym-counter-to-0.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Initialize-cl-gensym-counter-to-0.patch" >From c66ff5757c6eeb495eeb283f34fc0713d1fb5270 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 27 Jun 2015 10:57:02 -0700 Subject: [PATCH] Initialize cl--gensym-counter to 0 Previously it was initialized to a random value, which made it harder to reproduce earlier Emacs runs. The need for a random value went away when Emacs introduced and used the #: syntax for uninterned symbols (Bug#20862). * doc/misc/cl.texi (Creating Symbols, Common Lisp Compatibility): Document that cl--gensym-counter now starts with 0. * lisp/emacs-lisp/cl-lib.el (cl--gensym-counter): Remove. (cl--random-time): Move to near only remaining use. * lisp/emacs-lisp/cl-macs.el (cl--gensym-counter): Initialize to 0. --- doc/misc/cl.texi | 15 +++------------ lisp/emacs-lisp/cl-lib.el | 15 +++++---------- lisp/emacs-lisp/cl-macs.el | 2 +- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index d7b3f4a..1f38ca9 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -2877,14 +2877,8 @@ their names will not conflict with ``real'' variables in the user's code. (Internally, the variable @code{cl--gensym-counter} holds the counter -used to generate names. It is incremented after each use. In Common -Lisp this is initialized with 0, but this package initializes it with -a random time-dependent value to avoid trouble when two files that -each used @code{cl-gensym} in their compilation are loaded together. -Uninterned symbols become interned when the compiler writes them out -to a file and the Emacs loader loads them, so their names have to be -treated a bit more carefully than in Common Lisp where uninterned -symbols remain uninterned after loading.) +used to generate names. It is initialized with zero and incremented +after each use.) @end defun @defun cl-gentemp &optional x @@ -4543,10 +4537,7 @@ example, local @code{special} declarations, which are purely advisory in Emacs Lisp, do not rigorously obey the scoping rules set down in Steele's book. -The variable @code{cl--gensym-counter} starts out with a pseudo-random -value rather than with zero. This is to cope with the fact that -generated symbols become interned when they are written to and -loaded back from a file. +The variable @code{cl--gensym-counter} starts out with zero. The @code{cl-defstruct} facility is compatible, except that structures are of type @code{:type vector :named} by default rather than some diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index b6f3a79..2dd0519 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -249,16 +249,6 @@ so that they are registered at compile-time as well as run-time." `(progn ,@body)))) ; Avoid loading cl-macs.el for cl-eval-when. -;;; Symbols. - -(defun cl--random-time () - (let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0)) - (while (>= (cl-decf i) 0) (setq v (+ (* v 3) (aref time i)))) - v)) - -(defvar cl--gensym-counter (* (logand (cl--random-time) 1023) 100)) - - ;;; Numbers. (define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4") @@ -298,6 +288,11 @@ If true return the decimal value of digit CHAR in RADIX." (let ((n (aref cl-digit-char-table char))) (and n (< n (or radix 10)) n))) +(defun cl--random-time () + (let* ((time (copy-sequence (current-time-string))) (i (length time)) (v 0)) + (while (>= (cl-decf i) 0) (setq v (+ (* v 3) (aref time i)))) + v)) + (defvar cl--random-state (vector 'cl--random-state-tag -1 30 (cl--random-time))) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 636c543..5bcf088 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -161,7 +161,7 @@ whether X is known at compile time, macroexpand it completely in ;;; Symbols. -(defvar cl--gensym-counter) +(defvar cl--gensym-counter 0) ;;;###autoload (defun cl-gensym (&optional prefix) "Generate a new uninterned symbol. -- 2.1.0 --------------050304050008020003030002--