File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -880,7 +880,8 @@ def misra_5_4(self, data):
880880
881881 for x , m_var1 in enumerate (macro ):
882882 for y , m_var2 in enumerate (macro ):
883- if x < y and macro [m_var1 ]["name" ][:num_sign_chars ] == macro [m_var2 ]["name" ][:num_sign_chars ]:
883+ if x < y and macro [m_var1 ]["name" ] != macro [m_var2 ]["name" ] and \
884+ macro [m_var1 ]["name" ][:num_sign_chars ] == macro [m_var2 ]["name" ][:num_sign_chars ]:
884885 if m_var1 .linenr > m_var2 .linenr :
885886 self .reportError (m_var1 , 5 , 4 )
886887 else :
Original file line number Diff line number Diff line change @@ -104,6 +104,11 @@ void misra_5_3_enum_hidesfunction_31y(void) {} //5.3
104104#define misra_5_4_macro_hides_macro__31y 2 //5.4
105105#define m1 (misra_5_4_param_hides_macro__31y ) 1 //5.4
106106#define m2 (misra_5_4_param_hides_param__31x ,misra_5_4_param_hides_param__31y ) 1 //5.4
107+ #ifdef misra_5_4_macro_hides_macro__31x
108+ #define misra_5_4_macro 1 // no warning
109+ #else
110+ #define misra_5_4_macro 2 // no warning
111+ #endif
107112
108113#define misra_5_5_var_hides_macro____31x 1
109114#define misra_5_5_functionhides_macro31x 1
You can’t perform that action at this time.
0 commit comments