Visual Studio has a bug where it converts the integer literal 2147483648 into an unsigned int instead of a long long (i.e. it follows C89 rules). The bug has been reported as https://developercommunity.visualstudio.com/content/problem/141813/-2147483648-c4146-error.html. Because of this bug, we were getting a signed/unsigned comparison warning in VS2015 from the old code (the subsequent unary negation had no effect on the type).
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/28829 is an example build showing the warning.
Comment Actions
Thanks for cleaning this up. LGTM.
We could also fix this by using INT32_MIN or std::numeric_limts<int32_t>::min(), if preferred
Personally I prefer either of those over the raw numeric literal.
Comment Actions
Thanks, I've updated it, and will land the patch tomorrow, as I'm just leaving the office now.