AUTOSAR C++14 Rule A6-5-4

For-init-statement and expression should not perform actions other than loop-counter initialization and modification

Description

Rule Definition

For-init-statement and expression should not perform actions other than loop-counter initialization and modification.

Polyspace Implementation

  • Reports if loop parameter cannot be determined. Assumes JSF® C++ Rule 200 is not violated. The loop variable parameter is assumed to be a variable.

  • Assumes 1 loop parameter (see JSF C++ Rule 198), with non class type. JSF C++ Rule 200 must not be violated for this rule to be reported.

Troubleshooting

If you expect a rule violation but do not see it, refer to Coding Standard Violations Not Displayed.

Check Information

Group: Statements
Category: Advisory, Automated
Introduced in R2019a