Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
langc
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
bgColor#ccccff
langc
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

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.DCL19

Fully implemented

...