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
list.
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