@@ -881,59 +881,6 @@ def misra_5_2(self, data):
881881 else :
882882 self .reportError (scopename2 .bodyStart , 5 , 2 )
883883
884- def misra_5_3 (self , data ):
885- num_sign_chars = self .get_num_significant_naming_chars (data )
886- enum = []
887- scopeVars = {}
888- for var in data .variables :
889- if var .nameToken is not None :
890- if var .nameToken .scope not in scopeVars :
891- scopeVars [var .nameToken .scope ] = []
892- scopeVars [var .nameToken .scope ].append (var )
893- for innerScope in data .scopes :
894- if innerScope .type == "Enum" :
895- enum_token = innerScope .bodyStart .next
896- while enum_token != innerScope .bodyEnd :
897- if enum_token .values and enum_token .isName :
898- enum .append (enum_token .str )
899- enum_token = enum_token .next
900- continue
901- if innerScope not in scopeVars :
902- continue
903- if innerScope .type == "Global" :
904- continue
905- for innerVar in scopeVars [innerScope ]:
906- outerScope = innerScope .nestedIn
907- while outerScope :
908- if outerScope not in scopeVars :
909- outerScope = outerScope .nestedIn
910- continue
911- for outerVar in scopeVars [outerScope ]:
912- if innerVar .nameToken .str [:num_sign_chars ] == outerVar .nameToken .str [:num_sign_chars ]:
913- if outerVar .isArgument and outerScope .type == "Global" and not innerVar .isArgument :
914- continue
915- if int (innerVar .nameToken .linenr ) > int (outerVar .nameToken .linenr ):
916- self .reportError (innerVar .nameToken , 5 , 3 )
917- outerScope = outerScope .nestedIn
918- for scope in data .scopes :
919- if scope .className and innerVar .nameToken .str [:num_sign_chars ] == scope .className [:num_sign_chars ]:
920- if int (innerVar .nameToken .linenr ) > int (scope .bodyStart .linenr ):
921- self .reportError (innerVar .nameToken , 5 , 3 )
922- else :
923- self .reportError (scope .bodyStart , 5 , 3 )
924-
925- for e in enum :
926- for scope in data .scopes :
927- if scope .className and innerVar .nameToken .str [:num_sign_chars ] == e [:num_sign_chars ]:
928- if int (innerVar .nameToken .linenr ) > int (innerScope .bodyStart .linenr ):
929- self .reportError (innerVar .nameToken , 5 , 3 )
930- else :
931- self .reportError (innerScope .bodyStart , 5 , 3 )
932- for e in enum :
933- for scope in data .scopes :
934- if scope .className and scope .className [:num_sign_chars ] == e [:num_sign_chars ]:
935- self .reportError (scope .bodyStart , 5 , 3 )
936-
937884 def misra_5_4 (self , data ):
938885 num_sign_chars = self .get_num_significant_naming_chars (data )
939886 macro = {}
@@ -2471,7 +2418,6 @@ def parseDump(self, dumpfile):
24712418 self .executeCheck (402 , self .misra_4_2 , data .rawTokens )
24722419 self .executeCheck (501 , self .misra_5_1 , cfg )
24732420 self .executeCheck (502 , self .misra_5_2 , cfg )
2474- self .executeCheck (503 , self .misra_5_3 , cfg )
24752421 self .executeCheck (504 , self .misra_5_4 , cfg )
24762422 self .executeCheck (505 , self .misra_5_5 , cfg )
24772423 # 6.1 require updates in Cppcheck (type info for bitfields are lost)
0 commit comments