MISRA C:2012 Rule 17.12
A function identifier should only be used with either a preceding
&, or with a parenthesized parameter list
Since R2024a
Description
Rule Definition
A function identifier should only be used with either a preceding
&, or with a parenthesized parameter
list1
.
This rule comes from MISRA C™: 2012 Amendment 3.
Rationale
Using a function identifier without a preceding & or a
following parenthesized parameter list is confusing. It is not clear whether the intent
is to call a function or to obtain the address of the function.
Polyspace Implementation
This rule checker reports a violation if a function identifier is used without either of these:
A preceding
&A following parenthesized parameter list
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: Functions |
| Category: Advisory |
| AGC Category: Advisory |
Version History
Introduced in R2024a
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.