emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FIXNUM_OVERFLOW_P on amd64


From: Stefan Monnier
Subject: Re: FIXNUM_OVERFLOW_P on amd64
Date: Mon, 04 Dec 2006 10:01:59 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

> 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).

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.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]