MISRA C++:2008 Rule 0-1-11
There shall be no unused parameters (named or unnamed) in nonvirtual functions
Description
There shall be no unused parameters (named or unnamed) in nonvirtual functions. 1
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
1 All MISRA coding rules and directives are © Copyright The MISRA Consortium Limited 2021.
The MISRA coding standards referenced in the Polyspace Bug Finder™ documentation are from the following MISRA standards:
MISRA C:2004
MISRA C:2012
MISRA C:2023
MISRA C++:2008
MISRA C++:2023
MISRA and MISRA C are registered trademarks of The MISRA Consortium Limited 2021.