Integers (INT)
The following rules from the SEI CERT C Coding Standard also apply in C++:
- INT30-C. Ensure that unsigned integer operations do not wrap
- INT31-C. Ensure that integer conversions do not result in lost or misinterpreted data
- INT32-C. Ensure that operations on signed integers do not result in overflow
- INT33-C. Ensure that division and remainder operations do not result in divide-by-zero errors
- INT34-C. Do not shift an expression by a negative number of bits or by greater than or equal to the number of bits that exist in the operand
- INT35-C. Use correct integer precisions
- INT36-C. Converting a pointer to integer or integer to pointer
Information for Editors
To have a new guideline automatically listed above be sure to label it int and rule .
Risk Assessment Summary
| Rule | Severity | Likelihood | Detectable | Repairable | Priority | Level |
|---|---|---|---|---|---|---|
| INT50-CPP | Medium | Unlikely | Yes | No | P4 | L3 |


