Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 11.1 Interpretation
#1
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 ? */
<t></t>
#2
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.
Posted by and on behalf of the MISRA C Working Group


Forum Jump:


Users browsing this thread: 1 Guest(s)