This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] fix compiler warning of autological-constant-out-of-range-compare
Needs ReviewPublic

Authored by weimingz on Jun 24 2016, 5:22 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

warning: comparison of constant -2147483648 with expression of type 'long' (range [-2147483648, 2147483647]) is always false [-Wtautological-constant-out-of-range-compare]

As int and long maybe the same size on most architectures, the test doesn't really tell if the value is out of range or not.

The fix changes to "long long". But may still not the best way as there is no guarantee that it would be bigger than int.

Diff Detail

Event Timeline

weimingz updated this revision to Diff 61859.Jun 24 2016, 5:22 PM
weimingz retitled this revision from to [libcxx] fix compiler warning of autological-constant-out-of-range-compare.
weimingz updated this object.
weimingz added a subscriber: cfe-commits.