>> 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. _______________________________________________ emacs-pretest-bug mailing list [email protected] http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
