AUTOSAR C++14 Rule A7-1-7
Each expression statement and identifier declaration shall be placed on a separate line
Description
Rule Definition
Each expression statement and identifier declaration shall be placed on a separate line.
Rationale
In C++, you can place several statements on the same line, or declare multiple identifiers in the same statement. However, doing so might interfere with readability. For instance, declaring several identifiers on the same line might make it difficult to locate the declarations later.
Polyspace Implementation
The checker raises a violation when two consecutive declaration or expression statements are on the same line (unless the statements are part of a macro definition).
Troubleshooting
If you expect a rule violation but Polyspace® does not report it, see Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Declaration |
Category: Required, Automated |
Version History
Introduced in R2019a