@@ -4060,13 +4060,11 @@ def reportError(self, location, num1, num2):
40604060 misra_severity = self .ruleTexts [ruleNum ].misra_severity
40614061 cppcheck_severity = self .ruleTexts [ruleNum ].cppcheck_severity
40624062 elif len (self .ruleTexts ) == 0 :
4063+ errmsg = 'misra violation (use --rule-texts=<file> to get proper output)'
40634064 if self .path_premium_addon :
4064- errmsg = ''
4065- for line in subprocess .check_output ([self .path_premium_addon , '--cli' , '--get-rule-text=' + errorId ]).strip ().decode ('ascii' ).split ('\n ' ):
4065+ for line in cppcheckdata .cmd_output ([self .path_premium_addon , '--cli' , '--get-rule-text=' + errorId ]).split ('\n ' ):
40664066 if not line .startswith ('{' ):
40674067 errmsg = line
4068- else :
4069- errmsg = 'misra violation (use --rule-texts=<file> to get proper output)'
40704068 else :
40714069 errmsg = 'misra violation %s with no text in the supplied rule-texts-file' % (ruleNum )
40724070
@@ -4402,7 +4400,7 @@ def fillVerifyExpected(verify_expected, tok):
44024400
44034401 # Premium MISRA checking, deep analysis
44044402 if cfgNumber == 0 and self .path_premium_addon :
4405- subprocess .check_output ([self .path_premium_addon , '--cli' , '--misra' , dumpfile ])
4403+ subprocess .cmd_output ([self .path_premium_addon , '--cli' , '--misra' , dumpfile ])
44064404
44074405 def analyse_ctu_info (self , ctu_info_files ):
44084406 all_typedef_info = []
@@ -4667,7 +4665,7 @@ def main():
46674665 premium_command = [checker .path_premium_addon , '--misra' , '--file-list' , args .file_list ]
46684666 if args .cli :
46694667 premium_command .append ('--cli' )
4670- for line in subprocess .check_output (premium_command ). decode ( 'ascii' ).split ('\n ' ):
4668+ for line in subprocess .cmd_output (premium_command ).split ('\n ' ):
46714669 if re .search (r'"errorId".*:.*"misra-' , line ) is not None :
46724670 print (line .strip ())
46734671
0 commit comments