From: Francesco Potorti` <pot@gnu.org>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: FIXNUM_OVERFLOW_P on amd64
Date: Mon, 04 Dec 2006 17:12:18 +0100 [thread overview]
Message-ID: <E1GrGQU-0001E5-Sl@tucano.isti.cnr.it> (raw)
In-Reply-To: <jwvac23iu8q.fsf-monnier+emacs@gnu.org>
>
>> 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?
prev parent reply other threads:[~2006-12-04 16:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-04 11:48 FIXNUM_OVERFLOW_P on amd64 Francesco Potorti`
2006-12-04 15:01 ` Stefan Monnier
2006-12-04 16:12 ` Francesco Potorti` [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1GrGQU-0001E5-Sl@tucano.isti.cnr.it \
--to=pot@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).