http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43772

--- Comment #18 from eggert at gnu dot org 2012-04-28 21:53:30 UTC ---
(In reply to comment #17)
> I expect the remaining false positives to be very
> rare. i>=INT_MIN&&i<something or i<INT_MIN||i>something are common, but
> i<INT_MIN&&i>something seems less likely.

I'm afraid that false positives would still be likely.
For example, suppose we're on a platform where
INT_MAX = LONG_MAX < INTMAX_MAX.  Then:

  intmax_t i = (whatever);
  if (INT_MAX < i && i <= LONG_MAX)
     print ("i is in 'long' but not 'int' range");

This sort of thing is fairly common in portable code,
and GCC shouldn't warn about it merely because
we're on a platform where the two tests cannot both
be true when INT_MAX == LONG_MAX.

Reply via email to