 
                            ...
| Code Block | ||||
|---|---|---|---|---|
| 
 | ||||
| size_t i = 0;
for (i=0; i < 10; i++){
  /* Perform operations. */
}
 | 
Compliant Solution
Complying with this recommendation requires that you declare variables where they are used, which improves readability and reusability. In this example, you would declare the loop's index variable i within the initialization of the for loop. This requirement was recently relaxed in the C Standard.
| Code Block | ||||
|---|---|---|---|---|
| 
 | ||||
| for (size_t i=0; i < 10; i++) {
  /* Perform operations. */
}
 | 
Noncompliant Code Example (Function Declaration)
...
| Recommendation | Severity | Likelihood | Remediation Cost | Priority | Level | 
|---|---|---|---|---|---|
| DCL19-C | lowLow | unlikelyUnlikely | mediumMedium | P2 | L3 | 
Automated Detection
| Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| 
 | CC2.DCL19 | Fully implemented | 
...