Download User's Guide
Transcript
ForLoopVarAssign.rule
Items Enforced
ForLoopVarAssign.rule
Don't assign to loop control variables
in the body of a for loop
This rule checks whether you assign to loop control variables in the body
of a for loop.
Reason for rule: For loop control variables should only be modified in
the initialization and condition expressions of the for loop statement.
Modifying them inside the body of the for loop makes the loop condition
difficult to understand and points to a possible logical flaw in the code.
Example
void func() {
for (int i = 0; i < 100; i++) {
// Violation
i += 3;
}
for (int i = 0; i < 100; i++) {
i++;
}
}
256
// Violation
Related documents
User's Guide
User's Guide
RuleWizard User's Guide
Getting Started with the CodeVisionAVR Extension for Atmel Studio
CodeVisionAVR revision history
Pulse Width Modulation
INFINITI - NISSAN - Advanced Diagnostics USA
Załącznik nr 6 do ZW 15/2007
infiniti - nissan - adusa - Advanced Diagnostics USA
LOGGER ver.4.1. - USER MANUAL