If a constant value is given for an identifier, do not diminish the maintainability of the code in which it is used by assuming its value in expressions. Simply giving the constant a name is not enough to ensure modifiability; you must be careful to always use the name, and remember that the value can change. This recommendation is related to guideline recommendation DCL06-C. Use meaningful symbolic constants to represent literal values.
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
CERT C++ Secure Coding Standard: EXP07-CPP. Do not diminish the benefits of constants by assuming their values in expressions
ISO/IEC 9899:1999 Section 6.10, "Preprocessing directives," and Section 5.1.1, "Translation environment"
Bibliography
Wiki Markup |
---|
\[[Plum 1985|AA. Bibliography#Plum 85]\] Rule 1-5 \[[ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] Section 6.10, "Preprocessing directives," and Section 5.1.1, "Translation environment" |
...
EXP06-C. Operands to the sizeof operator should not contain side effects 03. Expressions (EXP)