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: Kim F. Storm
Subject: Re: warnings compiling Emacs 22 on amd64
Date: Tue, 16 Jan 2007 09:50:49 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux)

Richard Stallman <address@hidden> writes:

> I think we should demand some way to turn off the warning in specific
> places.  Does GCC have a feature to turn off warnings in a specific
> piece of code?  I don't remember.  It would be a good feature to have.
>
> However, a specific feature just for this kind of warning would also
> be useful.  I have an idea for what it could look like: an extra cast.
>
>       if ((int)(short)foo > (int)SHRT_MAX || (int)(short)foo < (int)SHRT_MIN)
>
> (short) would be a way of saying "yes I know this is a short", and
> this could suppress the warning.
>
> What do you think of that feature?

So you would define

    #define FIXNUM_OVERFLOW_P(i) \
      ((EMACS_INT)(i) > MOST_POSITIVE_FIXNUM \
       || (EMACS_INT) (i) < MOST_NEGATIVE_FIXNUM)

as

    #define FIXNUM_OVERFLOW_P(i) \
      ((EMACS_INT)(int)(i) > MOST_POSITIVE_FIXNUM \
       || (EMACS_INT)(int)(i) < MOST_NEGATIVE_FIXNUM)

Looks fine to me.

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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