Immutable objects should be const
-qualified. Enforcing object immutability using const
- qualification helps ensure the correctness and security of applications. ISO/IEC TR 24772, for example, recommends labeling parameters as constant to avoid the unintentional modification of function arguments [ISO/IEC TR 24772]. STR05-C. Use pointers to const when referring to string literals describes a specialized case of this recommendation.
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
Compass/ROSE |
|
|
| ||||||
| 78 D | Fully implemented | |||||||
PRQA QA-C |
| 3204 | Partially implemented |
Related Vulnerabilities
...
[Dewhurst 2002] | Gotcha #25, "#define Literals" | [ISO/IEC 9899:2011] | Section 6.7.3, "Type Qualifiers" |
---|---|---|---|
[Saks 2000] |