Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MISRA C 2004 rule 5.2 vioated on pointer as argument
#2
Assuming an example such as:
Code:
void * p_arg;
extern void SerialMaster_task(void *p_arg); /* no definition in translation unit */
"p_arg" will violate rule 5.2. Identifiers with "function prototype" scope are considered to be in an "inner scope" compared to the "outer scope" of "file" scope. Note: This example will also violate rule 5.7

"function prototype" scope is defined in section 6.1.2.1 on the C90 standard.
Quote:There are four kinds of scopes: function, file block and function prototype. ( A function prototype is a declaration of a function that declares the types of its parameters.)
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)