MISRA C:2012 Rule 23.8
A default association shall appear as either the first or the last association of a generic selection
Since R2024a
Description
Rule Definition
A default association shall appear as either the first or the last association of a generic selection.
This rule comes from MISRA C™: 2012 Amendment 3.
Rationale
The code is easier to read and understand when the default
association is either the first or the last association in a generic selection.
Polyspace Implementation
Polyspace® reports a violation of this rule if the default
association of a _Generic
statement is neither the first nor the last
association.
Troubleshooting
If you expect a rule violation but do not see it, refer to Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Generic Selections |
Category: Required |
AGC Category: Required |
Version History
Introduced in R2024a