[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
13.2 Integer Overflow
In practice many portable C programs assume that signed integer overflow wraps around reliably using two's complement arithmetic. Yet the C standard says that program behavior is undefined on overflow, and in a few cases C programs do not work on some modern implementations because their overflows do not wrap around as their authors expected. Conversely, in signed integer remainder, the C standard requires overflow behavior that is commonly not implemented.
13.2.1 Basics of Integer Overflow | Why integer overflow is a problem | |
13.2.2 Examples of Code Assuming Wraparound Overflow | Examples of code assuming wraparound | |
13.2.3 Optimizations That Break Wraparound Arithmetic | Optimizations that break uses of wraparound | |
13.2.4 Practical Advice for Signed Overflow Issues | Practical advice for signed overflow issues | |
13.2.5 Signed Integer Division and Integer Overflow | INT_MIN / -1 and INT_MIN % -1
|