...
defines an object-like macro that causes each subsequent instance of the macro name to be replaced by the replacement list of preprocessing tokens that constitute the remainder of the directive [ISO/IEC 9899:2011].
C programmers frequently define symbolic constants as object-like macros. For example, the code
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
Related Guidelines
...
DCL06-CPP. Use meaningful symbolic constants to represent literal values in program logic | |
---|---|
ISO/IEC TR 24772 | "BRS Leveraging human experience" |
MITRE CWE | CWE-547, "Use of hard-coded, security-relevant constants" |
Bibliography
[Henricson 1992] | Chapter 10, "Constants" |
---|---|
[ISO/IEC 9899:2011 |
...
] | Section 6.3.2.1, "Lvalues, |
...
Arrays, and |
...
Function Designators," section 6.7, "Declarations," section 6.7.2.2, "Enumeration |
...
ISO/IEC TR 24772 "BRS Leveraging human experience"
MITRE CWE: CWE-547, "Use of hard-coded, security-relevant constants"
Bibliography
...
Specifiers," and section 6.10.3, "Macro |
...
Replacement" |
[ |
...