Main Content
AUTOSAR C++14 Rule M7-4-3
Assembly language shall be encapsulated and isolated
Description
Rule Definition
Assembly language shall be encapsulated and isolated.
Rationale
Assembler instructions can be difficult to port across implementations. Encapsulating and isolating them in a function helps to make your code portable. You can easily track down assembler instructions or provide alternative implementations without changing the rest of the code.
Polyspace Implementation
The checker flags asm
statements unless they are encapsulated in a function call.
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