From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francesco Potorti` Newsgroups: gmane.emacs.devel Subject: Re: FIXNUM_OVERFLOW_P on amd64 Date: Mon, 04 Dec 2006 17:12:18 +0100 Message-ID: References: NNTP-Posting-Host: dough.gmane.org X-Trace: sea.gmane.org 1165273686 4637 80.91.229.10 (4 Dec 2006 23:08:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Dec 2006 23:08:06 +0000 (UTC) Cc: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 05 00:08:04 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GrMup-0007jB-03 for ged-emacs-devel@m.gmane.org; Tue, 05 Dec 2006 00:08:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GrMuo-0002jT-FN for ged-emacs-devel@m.gmane.org; Mon, 04 Dec 2006 18:08:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GrMuc-0002jM-FP for emacs-devel@gnu.org; Mon, 04 Dec 2006 18:07:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GrMua-0002jA-25 for emacs-devel@gnu.org; Mon, 04 Dec 2006 18:07:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GrMuZ-0002j7-Rn for emacs-devel@gnu.org; Mon, 04 Dec 2006 18:07:47 -0500 Original-Received: from [194.119.192.4] (helo=mx2.isti.cnr.it) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GrMuZ-0004pf-H3 for emacs-devel@gnu.org; Mon, 04 Dec 2006 18:07:47 -0500 Original-Received: from conversionlocal.isti.cnr.it by mx.isti.cnr.it (PMDF V6.3-x3 #31251) id <01MAC3YG4XLC9S73VF@mx.isti.cnr.it> for emacs-devel@gnu.org; Mon, 04 Dec 2006 17:13:14 +0100 Original-Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) by mx.isti.cnr.it (PMDF V6.3-x3 #31251) with ESMTPS id <01MAC3XEY9VI9VVPOT@mx.isti.cnr.it>; Mon, 04 Dec 2006 17:12:22 +0100 Original-Received: from pot by tucano.isti.cnr.it with local (Exim 4.63) (envelope-from ) id 1GrGQU-0001E5-Sl; Mon, 04 Dec 2006 17:12:18 +0100 In-reply-to: Original-To: Stefan Monnier X-INSM-ip-source: 146.48.81.102 Auth Optional-NoAuth X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 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:63278 Archived-At: > >> gcc -c -D_BSD_SOURCE -Demacs -DHAVE_CONFIG_H -I. -I/home/pot/gnu/emacs-22.0.91/src -D_BSD_SOURCE -g -O2 -Wno-pointer-sign editfns.c >> editfns.c: In function 'Fuser_uid': >> editfns.c:1317: warning: comparison is always false due to limited range of data type >> editfns.c:1317: warning: comparison is always false due to limited range of data type >[...] >> So the problem apparently is that gcc realises that taking geteuid(), >> stretching it to long and then comparing it with something bigger that >> what geteuid() possibly can be is a no-op. This is what is intended, in >> fact. To remove the warning, I tried to change the definition of >> FIXNUM_OVERFLOW_P in lisp.h by adding a precondition like this: > >This warning is clearly wrong. The same problem happens at various places >with SINGLE_BYTE_P which is sometimes called from a macro at spots where we >happen to always know that the char is < 256 (for example). I also have many others. Most of them are related to the same macro in lisp.h. >The problem is that such constant expressions are sometimes an indication of >a programming bug, but they can also be the result of very good coding >practices, where you want to let the compiler do the optimization. Yes. Can we do anything for preventing gcc from emitting those warnings?