From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: integer overflow Date: Fri, 05 Mar 2010 17:35:25 -0500 Message-ID: References: <4B8147A9.7030504@gmail.com> <87ljemdzxo.fsf@stupidchicken.com> <4B83682D.5010804@gnu.org> <87vddmpw4s.fsf@stupidchicken.com> <87hbp2fwoi.fsf@gnu.org> <87wrxrr4md.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1267828586 6620 80.91.229.12 (5 Mar 2010 22:36:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 5 Mar 2010 22:36:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 05 23:36:22 2010 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Nng85-0002jI-NV for ged-emacs-devel@m.gmane.org; Fri, 05 Mar 2010 23:36:22 +0100 Original-Received: from localhost ([127.0.0.1]:47814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nng84-0002Un-U6 for ged-emacs-devel@m.gmane.org; Fri, 05 Mar 2010 17:36:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nng80-0002Ue-O8 for emacs-devel@gnu.org; Fri, 05 Mar 2010 17:36:16 -0500 Original-Received: from [140.186.70.92] (port=38981 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nng7P-0002Hx-Eo for emacs-devel@gnu.org; Fri, 05 Mar 2010 17:36:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nng7O-0007Pp-9B for emacs-devel@gnu.org; Fri, 05 Mar 2010 17:35:39 -0500 Original-Received: from tomts22.bellnexxia.net ([209.226.175.184]:57292 helo=tomts22-srv.bellnexxia.net) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nng7N-0007PZ-NJ; Fri, 05 Mar 2010 17:35:38 -0500 Original-Received: from toip4.srvr.bell.ca ([209.226.175.87]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20100305223526.NWPS22975.tomts22-srv.bellnexxia.net@toip4.srvr.bell.ca>; Fri, 5 Mar 2010 17:35:26 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAAwQkUtGN5E3/2dsb2JhbACbSHS2eoR3BIMX Original-Received: from bas1-montreal42-1178046775.dsl.bell.ca (HELO ceviche.home) ([70.55.145.55]) by toip4.srvr.bell.ca with ESMTP; 05 Mar 2010 17:58:03 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 987F2B4257; Fri, 5 Mar 2010 17:35:25 -0500 (EST) In-Reply-To: (Glenn Morris's message of "Fri, 05 Mar 2010 14:50:01 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:121665 Archived-At: >> In 2.3.1 Integer Type: >>> 1073741825 ; Also the integer 1 on a 30-bit implementation. >> In 3.1 Integer Basics: >>> 1073741825 ; Also the integer 1, due to overflow. >> When in fact (type-of 1073741825) => float! >> Is this even documented? > A good question. I can't see anything about this in NEWS. > Might it be the following change? > 2009-08-27 Stefan Monnier > * lread.c (read_integer): Use doubles (and potentially > return a float number) as we do in string-to-number. > (read1): Use strtol to read integers, signal errors on > strtol's overflow and use floats if strtol's output is too large for > Elisp integers. Indeed, I thought about it as a pure bug-fix, but it needs to be added to the NEWS. Can you do that and update the doc accordingly? Stefan