Richard Stallman wrote:
If not, I think one ought to be implemented.  I have a suggestion for
what it could look like:

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

The casts to int could be interpreted as meaning "yes I know this is
limited to the range of of ints, so don't warn me about the
consequences of that fact."

It appears to me that this syntax wouldn't work for the primary purpose that you're using this for, though. If this is applied to an expression that's of larger-than-int type and is outside the range of ints, won't this syntax always convert it to something that is inside the range of ints? And so, if MOST_POSITIVE_FIXNUM and MOST_NEGATIVE_FIXNUM are such that the original syntax would always be false when i is an int expression, won't this version result in something that's always false even for out-of-range larger-than-int expressions?

- Brooks

Reply via email to