emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: warnings compiling Emacs 22 on amd64


From: Francesco Potorti`
Subject: Re: warnings compiling Emacs 22 on amd64
Date: Tue, 12 Dec 2006 14:46:32 +0100

>> If the argument i is of type int (32bit), then the compiler is sufficiently
>> clever to infer that the comparisons will always return the same value
>> (even though we cast that value to EMACS_INT (64bit) in between).
>
>Is it really that smart?  

Apparently, yes.  But also enough stupid that it makes that comparison
when it is useless (as I tried to have it understand using sizeof()).

>                          Will it also be that smart if we do some
>arithmetics, like `(EMACS_INT)i + 0L' or `(EMACS_INT)i*1L'?

Will try that and see if it is useful to make the warning go away.

>> > If FIXNUM_OVERFLOW_P should always return zero on 64-bit machines,
>> 
>> It shouldn't.  There are a few sites where it does, tho.
>
>Are these few cases those for which the argument of FIXNUM_OVERFLOW_P
>is an int (rather than a long)?

No, it will always return 0 if (sizeof(i) < sizeof(EMACS_INT)), but it
may not return 0 if (i) has the same or greater size than EMACS_INT.  On
amd64, this happens when (i) is long.

>> There is no problem other than unhelpful warnings.

Well, that's exactly the problem :-)
Having spurious warnings should be avoided, if at all possible.

>> We can probably remove those warnings with the right -Wno-foo
>> invocation.

No, that would mask out other possible cases when the warning is
significant.




reply via email to

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