From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: macro FIXNUM_OVERFLOW_P in lisp.h is valid ? Date: Fri, 23 Oct 2009 22:57:07 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1256332180 27228 80.91.229.12 (23 Oct 2009 21:09:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Oct 2009 21:09:40 +0000 (UTC) Cc: emacs-devel@gnu.org To: Toru TSUNEYOSHI Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 23 23:09:33 2009 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.50) id 1N1RO9-0002y2-CP for ged-emacs-devel@m.gmane.org; Fri, 23 Oct 2009 23:09:33 +0200 Original-Received: from localhost ([127.0.0.1]:60571 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1RO8-0004Mx-PU for ged-emacs-devel@m.gmane.org; Fri, 23 Oct 2009 17:09:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1RCG-0004qL-K3 for emacs-devel@gnu.org; Fri, 23 Oct 2009 16:57:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1RCB-0004jI-D8 for emacs-devel@gnu.org; Fri, 23 Oct 2009 16:57:15 -0400 Original-Received: from [199.232.76.173] (port=52123 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1RCB-0004j6-8c for emacs-devel@gnu.org; Fri, 23 Oct 2009 16:57:11 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.10]:60008) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N1RCA-0006vU-RA for emacs-devel@gnu.org; Fri, 23 Oct 2009 16:57:11 -0400 Original-Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 77C8F1C0010B; Fri, 23 Oct 2009 22:57:09 +0200 (CEST) Original-Received: from localhost (dynscan2.mnet-online.de [192.168.1.215]) by mail.m-online.net (Postfix) with ESMTP id 537D090207; Fri, 23 Oct 2009 22:57:09 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Original-Received: from mail.mnet-online.de ([192.168.3.149]) by localhost (dynscan2.mnet-online.de [192.168.1.215]) (amavisd-new, port 10024) with ESMTP id i6FvoE9CNqoA; Fri, 23 Oct 2009 22:57:08 +0200 (CEST) Original-Received: from igel.home (DSL01.83.171.152.41.ip-pool.NEFkom.net [83.171.152.41]) by mail.mnet-online.de (Postfix) with ESMTP; Fri, 23 Oct 2009 22:57:08 +0200 (CEST) Original-Received: by igel.home (Postfix, from userid 501) id 21DDD10C4CB; Fri, 23 Oct 2009 22:57:08 +0200 (CEST) X-Yow: If elected, Zippy pledges to each and every American a 55-year-old houseboy... In-Reply-To: (Toru TSUNEYOSHI's message of "Sat, 24 Oct 2009 02:51:47 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:116342 Archived-At: Toru TSUNEYOSHI writes: > I read the code of function `string-to-number', and traced functions or > macros recursively. > > traces of string-to-number: > > data.c: Fstring_to_number > lisp.h: make_fixnum_or_float > lisp.h: FIXNUM_OVERFLOW_P > > citation of FIXNUM_OVERFLOW_P (in Emacs 23.1): > > /* Value is non-zero if C integer I doesn't fit into a Lisp fixnum. */ > > #define FIXNUM_OVERFLOW_P(i) \ > ((EMACS_INT)(i) > MOST_POSITIVE_FIXNUM \ > || (EMACS_INT) (i) < MOST_NEGATIVE_FIXNUM) > > I think FIXNUM_OVERFLOW_P is problematic. Thanks for the report. The right fix is to remove the cast, so that the compiler will promote the operands to the appropriate common type. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."