From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Making --with-wide-int the default Date: Sun, 15 Nov 2015 17:01:40 +0100 Message-ID: <871tbrmeu3.fsf@fencepost.gnu.org> References: <56117F37.9060808@dancol.org> <83oag087gs.fsf@gnu.org> <83oafz70im.fsf@gnu.org> <5620AF43.4050401@cs.ucla.edu> <83k2qn6xfm.fsf@gnu.org> <5620B4FA.1000804@cs.ucla.edu> <83wptojs1r.fsf@gnu.org> <56444C66.8050506@gmx.at> <83r3jugx8g.fsf@gnu.org> <87io56nu0a.fsf@fencepost.gnu.org> <83lha1dl87.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447708006 10129 80.91.229.3 (16 Nov 2015 21:06:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Nov 2015 21:06:46 +0000 (UTC) Cc: rudalics@gmx.at, jwiegley@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 16 22:06:40 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZyQz1-0000Jm-MT for ged-emacs-devel@m.gmane.org; Mon, 16 Nov 2015 22:06:39 +0100 Original-Received: from localhost ([::1]:49462 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZyQz1-0002fl-B6 for ged-emacs-devel@m.gmane.org; Mon, 16 Nov 2015 16:06:39 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zxzlc-0008T9-37 for emacs-devel@gnu.org; Sun, 15 Nov 2015 11:03:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zxzlb-0003nx-6q for emacs-devel@gnu.org; Sun, 15 Nov 2015 11:03:00 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxzlW-0003mv-Kx; Sun, 15 Nov 2015 11:02:54 -0500 Original-Received: from localhost ([127.0.0.1]:42444 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1ZxzlP-0000th-Bn; Sun, 15 Nov 2015 11:02:47 -0500 Original-Received: by lola (Postfix, from userid 1000) id 4B765DFA96; Sun, 15 Nov 2015 17:01:40 +0100 (CET) In-Reply-To: <83lha1dl87.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 14 Nov 2015 10:43:52 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:194551 Archived-At: Eli Zaretskii writes: >> From: Richard Stallman >> CC: eliz@gnu.org, rudalics@gmx.at, jwiegley@gmail.com, >> emacs-devel@gnu.org >> Date: Fri, 13 Nov 2015 17:03:10 -0500 >> >> > I think it is quite reasonable _not_ to use wide ints by >> > default on architectures with a 32-bit address space. >> >> +1. > > Faced with such powerful opposition, I guess this now becomes your > decision, John. I can always build my own Emacs with that option; the > question is what we want for the majority of our users on 32-bit > systems. Here is another data point: the code base seems woefully unprepared to actually deal with the resulting ranges. Lisp integers are only converted with macros XINT and XFASTINT as far as I can tell, and git grep XINT shows lots of assignments to variables of type int rather than EMACS_INT. I think that there should be macros XINT, XUINT, XEINT (for EMACS_INT) which trigger a range error when the value does not fit the respective range. Possibly also XLONG and XULONG but I'm not sure we actually have platforms where long/int are different. Some of those uses may well be security problems. Using EMACS_INT everywhere might be inappropriate (where's the point in having array indexes longer than the addressable memory space?) but then we should likely get range errors. Of course, doing this properly might also mean less work for moving to arbitrary-size integers eventually (probably using the Lisp_Int1 tag when the 28-bit range does not suffice), though that one will likely need a lot of converting `eq' -> `eql' in the Lisp code base. But first we should get wide ints behave sensibly when their range exceeds the expected target range. -- David Kastrup