Expressions (EXP)
- EXP50-CPP. Do not depend on the order of evaluation for side effects
- EXP51-CPP. Do not delete an array through a pointer of the incorrect type
- EXP52-CPP. Do not rely on side effects in unevaluated operands
- EXP53-CPP. Do not read uninitialized memory
- EXP54-CPP. Do not access an object outside of its lifetime
- EXP55-CPP. Do not access a cv-qualified object through a cv-unqualified type
- EXP56-CPP. Do not call a function with a mismatched language linkage
- EXP57-CPP. Do not cast or delete pointers to incomplete classes
- EXP58-CPP. Pass an object of the correct type to va_start
- EXP59-CPP. Use offsetof() on valid types and members
- EXP60-CPP. Do not pass a nonstandard-layout type object across execution boundaries
- EXP61-CPP. A lambda object must not outlive any of its reference captured objects
- EXP62-CPP. Do not access the bits of an object representation that are not part of the object's value representation
- EXP63-CPP. Do not rely on the value of a moved-from object
The following rules from the SEI CERT C Coding Standard also apply in C++:
- EXP34-C. Do not dereference null pointers
- EXP35-C. Do not modify objects with temporary lifetime
- EXP36-C. Do not cast pointers into more strictly aligned pointer types
- EXP37-C. Call functions with the correct number and type of arguments
- EXP39-C. Do not access a variable through a pointer of an incompatible type
- EXP42-C. Do not compare padding data
- EXP45-C. Do not perform assignments in selection statements
- EXP46-C. Do not use a bitwise operator with a Boolean-like operand
- EXP47-C. Do not call va_arg with an argument of the incorrect type
Information for Editors
To have a new guideline automatically listed above be sure to label it exp and rule .
Risk Assessment Summary
| Rule | Severity | Likelihood | Detectable | Repairable | Priority | Level |
|---|---|---|---|---|---|---|
| EXP50-CPP | Medium | Probable | No | Yes | P8 | L2 |
| EXP51-CPP | Low | Unlikely | No | No | P1 | L3 |
| EXP52-CPP | Low | Unlikely | Yes | Yes | P3 | L3 |
| EXP53-CPP | High | Probable | No | Yes | P12 | L1 |
| EXP54-CPP | High | Probable | No | No | P6 | L2 |
| EXP55-CPP | Medium | Probable | No | No | P4 | L3 |
| EXP56-CPP | Low | Unlikely | No | Yes | P2 | L3 |
| EXP57-CPP | Medium | Unlikely | Yes | No | P4 | L3 |
| EXP58-CPP | Medium | Unlikely | Yes | No | P4 | L3 |
| EXP59-CPP | Medium | Unlikely | Yes | No | P4 | L3 |
| EXP60-CPP | High | Probable | No | No | P6 | L2 |
| EXP61-CPP | High | Probable | No | No | P6 | L2 |
| EXP62-CPP | High | Probable | Yes | No | P12 | L1 |
| EXP63-CPP | Medium | Probable | Yes | No | P8 | L2 |


