Re:Cap'n'Proto remote vuln: pointer overflow check optimized...
by esrauch on Friday April 21, 2017 @08:47AM
(#14165034)
I think the situation is a lot more nuanced than that. The issue was that additition overflow is undefined behavior for both signed ints and pointers (but it is defined for unsigned ints).
The fix commit changes it to use an unsigned integer type instead, so it seems like a concrete example for the exact opposite of your suggestion.
The standards I'm recalling were in-house standards, but a quick Google shows that Google have published their standard and they warn against unsigned too: https://google.github.io/styleguide/cppguide.html#Integer_Ty...
Bottom line: avoid unsigned for numbers. Use unsigned only for bags of bits.