MISRA Discussion Forums

Full Version: Rule 11.1 Interpretation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Rule 11.1 says that, 'coversions shall not be performed between a pointer to a function and any other type other than an integral type'

what do the 'integral type' refer to?

Is there a violation in the following code:

int (*p)();
int *a;
p = a; /* is this a violation of Misra rule 11.1 ? */
integral type is defined char, short, int, long, ( signed and unsigned).

Your code example is a constraint error, which breaks rule 1.1.

Most pointer conversions require an explicit cast.