05-06-2014, 04:32 PM
I have a customer for our compiler who is asking this question:
Rule 5.2 deals with identifiers declared with block scope that hide identifiers declared at an outer block, or file, scope. It does not apply to identifiers declared in other translation units.
extern void SerialMaster_task(void *p_arg);
Warning[Pm017]: symbol hides parameter "p_arg" (declared at line 380) - identifiers in an inner scope shall not use the same name as an identifier in an outer scope, and therefore hide the identifier (MISRA C 2004 rule 5.2)
A parameter in the *declaration* of an external subroutine does not define a symbol in the current context.
---
Can you elaborate about why the source line above invokes MISRA C 2004 rule 5.2?
Dave Bailey
IAR Systems
Rule 5.2 deals with identifiers declared with block scope that hide identifiers declared at an outer block, or file, scope. It does not apply to identifiers declared in other translation units.
extern void SerialMaster_task(void *p_arg);
Warning[Pm017]: symbol hides parameter "p_arg" (declared at line 380) - identifiers in an inner scope shall not use the same name as an identifier in an outer scope, and therefore hide the identifier (MISRA C 2004 rule 5.2)
A parameter in the *declaration* of an external subroutine does not define a symbol in the current context.
---
Can you elaborate about why the source line above invokes MISRA C 2004 rule 5.2?
Dave Bailey
IAR Systems
<t></t>