MISRA C++:2008 Rule 0-1-11
There shall be no unused parameters (named or unnamed) in nonvirtual functions
Description
Rule Definition
There shall be no unused parameters (named or unnamed) in nonvirtual functions.
Rationale
Unused parameters often indicate later design changes. You perhaps removed all uses of a specific parameter but forgot to remove the parameter from the parameter list.
Unused parameters constitute an unnecessary overhead. You can also inadvertently call the function with a different number of arguments causing a parameter mismatch.
Polyspace Implementation
The checker flags a function that has unused named parameters unless the function body is empty.
Additional Message in Report
Function
has unused
parameters. funcName
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: Language Independent Issues |
Category: Required |
Version History
Introduced in R2016b