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: Sat, 24 Oct 2009 12:01:20 +0200 Message-ID: References: <83ws2lg44u.fsf@gnu.org> <83tyxpf8zy.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1256378510 25391 80.91.229.12 (24 Oct 2009 10:01:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 Oct 2009 10:01:50 +0000 (UTC) Cc: t_tuneyosi@hotmail.com, Stefan Monnier , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 24 12:01:43 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 1N1dRP-0001OO-0N for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2009 12:01:43 +0200 Original-Received: from localhost ([127.0.0.1]:53365 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1dRN-0006rG-PS for ged-emacs-devel@m.gmane.org; Sat, 24 Oct 2009 06:01:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N1dRD-0006r0-Dh for emacs-devel@gnu.org; Sat, 24 Oct 2009 06:01:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N1dR7-0006qA-U7 for emacs-devel@gnu.org; Sat, 24 Oct 2009 06:01:30 -0400 Original-Received: from [199.232.76.173] (port=39868 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N1dR7-0006q6-H2 for emacs-devel@gnu.org; Sat, 24 Oct 2009 06:01:25 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.10]:47465) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N1dR5-0003JY-0g; Sat, 24 Oct 2009 06:01:23 -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 4ED3F1C001C7; Sat, 24 Oct 2009 12:01:21 +0200 (CEST) X-Auth-Info: Rrl/NQ2szs+xb2pJCxe18M7L+yib5t03ZHe67aaobVM= Original-Received: from whitebox.home (DSL01.83.171.146.84.ip-pool.NEFkom.net [83.171.146.84]) by mail.mnet-online.de (Postfix) with ESMTP id CAA3D90292; Sat, 24 Oct 2009 12:01:21 +0200 (CEST) Original-Received: by whitebox.home (Postfix, from userid 501) id D58F11E5379; Sat, 24 Oct 2009 12:01:20 +0200 (CEST) X-Yow: ..Wait 'til those ITALIAN TEENAGERS get back to their HONDAS & discover them to be FILLED to the BRIM with MAZOLA!! In-Reply-To: <83tyxpf8zy.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 24 Oct 2009 11:15:29 +0200") 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:116357 Archived-At: Eli Zaretskii writes: >> From: Stefan Monnier >> Date: Fri, 23 Oct 2009 21:05:05 -0400 >> Cc: t_tuneyosi@hotmail.com, Andreas Schwab , >> emacs-devel@gnu.org >> >> Actually, when the cast was added in 2001, it came with the following >> commit-log-comment: >> >> (FIXNUM_OVERFLOW_P): Cast I to EMACS_INT in comparisons >> in case I is of some unsigned type, in which case >> MOST_NEGATIVE_FIXNUM will be converted to unsigned, and the >> comparison becomes bogus. > > Right, sorry for my failing memory. > > So I think the change made yesterday by Andreas should be reverted. These should also work with unsigned types, but may generate extra warnings: #define FIXNUM_OVERFLOW_P(i) \ (((i) > 0 && (i) > MOST_POSITIVE_FIXNUM) \ || ((i) < 0 && (i) < MOST_NEGATIVE_FIXNUM)) or: #define FIXNUM_OVERFLOW_P(i) \ !((i) <= MOST_POSITIVE_FIXNUM \ && (i) >= MOST_NEGATIVE_FIXNUM) 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."