From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Preventing warnings in FIXNUM_OVERFLOW_P Date: Thu, 18 Jan 2007 23:49:44 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1169157008 28955 80.91.229.12 (18 Jan 2007 21:50:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2007 21:50:08 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 18 22:50:05 2007 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 1H7f91-0000VP-1K for ged-emacs-devel@m.gmane.org; Thu, 18 Jan 2007 22:50:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7f91-0008PL-VN for ged-emacs-devel@m.gmane.org; Thu, 18 Jan 2007 16:50:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H7f8f-0008CS-EV for emacs-devel@gnu.org; Thu, 18 Jan 2007 16:49:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H7f8d-00089Y-MH for emacs-devel@gnu.org; Thu, 18 Jan 2007 16:49:40 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7f8d-00089N-H3 for emacs-devel@gnu.org; Thu, 18 Jan 2007 16:49:39 -0500 Original-Received: from [213.8.233.22] (helo=nitzan.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H7f8c-0000eK-7A; Thu, 18 Jan 2007 16:49:38 -0500 Original-Received: from HOME-C4E4A596F7 (IGLD-84-229-126-51.inter.net.il [84.229.126.51]) by nitzan.inter.net.il (MOS 3.7.3a-GA) with ESMTP id FUW63125 (AUTH halo1); Thu, 18 Jan 2007 23:49:32 +0200 (IST) Original-To: rms@gnu.org In-reply-to: (message from Richard Stallman on Thu, 18 Jan 2007 12:27:57 -0500) 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:65288 Archived-At: > From: Richard Stallman > Date: Thu, 18 Jan 2007 12:27:57 -0500 > > Ian Lance Taylor wrote: > > You can avoid it by using unsigned types. I think that something like > this will do the trick: > > #define FIXNUM_OVERFLOW_P(i) \ > ((unsigned long long)(i) > MOST_POSITIVE_FIXNUM \ > && (unsigned long long)(i) < MOST_NEGATIVE_FIXNUM) > > Would someone please give that approach a try and see if it works? It seems to work. > I am having too much trouble with concentration right now to see > whether that code is correct Which is precisely the problem with this solution: it is no longer clear that the code does what we want, since mixing signed with unsigned produces confusing code and is generally asking for trouble. And then there's what David said about long long: if we use the above, we will need to have two versions of the macro: one for GCC, the other for other compilers. So on balance, I think this solution is worse than my workaround. It sounds like GCC maintainers are working on fixing this in a future version. So I'd suggest to leave this alone until then.