I'm using "IAR RL78" and "RL78-R5F10BGG" microcontroller. I also have enabled MISRA C 2004 in IAR.
I wanna define one of my functions as "inline". This inline function is supposed to be used in various c file. So I have defined the function in one of my
header files and include that header file in all c files which need the function. But my problem is because of MISRA C 8.5 rule after compilation. It says:
Error[Pm123]: there shall be no definition of objects or functions in a header file (MISRA C 2004 rule 8.5)
The following is the definition of the inline function in common.h header:
static inline int16u SET_BIT(int16u int16uVar, int16u int16uBitIndex);
#pragma inline=forced
static inline int16u SET_BIT(int16u int16uVar, int16u int16uBitIndex)
{
int16uVar |= ( (int16u)1u << (int16uBitIndex) );
return int16uVar ;
}
What's the problem?
Is there any way to get rid of this problem?