[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FIXNUM_OVERFLOW_P on amd64
From: |
Francesco Potorti` |
Subject: |
Re: FIXNUM_OVERFLOW_P on amd64 |
Date: |
Mon, 04 Dec 2006 17:12:18 +0100 |
>
>> 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?