整理代码,消除warning, 遇到一件很有趣的事:
编译告警为:warning :decimal constant is so large that it is unsigned
表示代码行为:
在网上google后将代码改为如下后warning消除:
解释为:
The number is 2147483648, and that's too big for the standard "int" so GCC has to force its type to "unsigned int". Hence the warning. The best way to fix it is to use -2147483647 - 1 which doesn't suffer from overflow issues.