...
A preprocessing directive of the form:
#
define
identifier replacement-list
...
defines buffer_size
as a macro whose value is 256. The preprocessor substitutes macros before the compiler does any other symbol processing. Later compilation phases never see macro symbols such as buffer_size
; they see only the source text after macro substitution. ConsequentlyAs a result, many compilers do not preserve macro names among the symbols they pass on to their debuggers.
Macro names do not observe the scope rules that apply to other names. ConsequentlyResultantly, macros might substitute in unanticipated places with unexpected results.
...
Code Block | ||
---|---|---|
| ||
/* ... */ if (age >= 18) { /* Take action */ } else { /* Take a different action */ } /* ... */ |
Compliant Solution
The This compliant solution replaces the integer literal 18 with the symbolic constant ADULT_AGE
to clarify the meaning of the code.
...