mirror of
https://github.com/github/codeql.git
synced 2026-03-28 10:18:17 +01:00
1. The two last examples were misleading at best. The first of those two recommended casting to non-negative `int`s to `unsigned int` and then checking if their addition would overflow, but overflow was impossible because their sum (on 32-bit two's complement) could be at most 2^32 - 2. The second example could lead to the wrong condition (unsigned overflow) being checked if taken literally. Instead of keeping that example, I reworeded the first paragraph of the Recommendation section. 2. The assumptions about `delta` being positive was relaxed to non-negative. 3. There was no need to assume that an unsigned short was non-negative. 4. Some of the suggestions were missing `i >`.