01-03-2018, 04:08 PM
Hello,
I am getting MISRA 5.2 rule violation in my project. The code for which i am getting violation is a structure that is declared as extern in one header file. The code example is as under
1.h
2.c
3.c
I get the warning only in 2.c in the line struct con tmp_ev; saying that declaration of symbol tmp_ev hides symbol tmp_ev and not in 3.c . Both 2.c and 3.c include the 1.h header file.
I am confused why this issue is present. Can anyone help me resolve this issue?
Thank you
I am getting MISRA 5.2 rule violation in my project. The code for which i am getting violation is a structure that is declared as extern in one header file. The code example is as under
1.h
Code:
extern struct con tmp_ev;
2.c
Code:
struct con tmp_ev;
cioF_get(&tmp_ev);
3.c
Code:
struct con tmp_ev;
(void)eeF_read(CON, &tmp_ev);
I get the warning only in 2.c in the line struct con tmp_ev; saying that declaration of symbol tmp_ev hides symbol tmp_ev and not in 3.c . Both 2.c and 3.c include the 1.h header file.
I am confused why this issue is present. Can anyone help me resolve this issue?
Thank you
<t></t>