@@ -4070,6 +4070,24 @@ def misra_22_10(self, cfg):
4070
4070
elif not is_errno_setting_function (last_function_call ):
4071
4071
self .reportError (token , 22 , 10 )
4072
4072
4073
+ def misra_23_6 (self , cfg ):
4074
+ """Part of the 23.6"""
4075
+ def get_category (essential_type ):
4076
+ if essential_type :
4077
+ if essential_type == 'bool' :
4078
+ return essential_type
4079
+ return None
4080
+ for tok in cfg .tokenlist :
4081
+ if tok .isAssignmentOp :
4082
+ lhs = getEssentialType (tok .astOperand1 )
4083
+ rhs = getEssentialType (tok .astOperand2 )
4084
+ if lhs is None or rhs is None :
4085
+ continue
4086
+ lhs_is_bool = lhs == 'bool'
4087
+ rhs_is_bool = rhs == 'bool'
4088
+ if lhs_is_bool :
4089
+ if not rhs_is_bool :
4090
+ self .reportError (tok , 23 , 6 )
4073
4091
4074
4092
def get_verify_expected (self ):
4075
4093
"""Return the list of expected violations in the verify test"""
@@ -4678,6 +4696,7 @@ def fillVerifyExpected(verify_expected, tok):
4678
4696
self .executeCheck (2208 , self .misra_22_8 , cfg )
4679
4697
self .executeCheck (2209 , self .misra_22_9 , cfg )
4680
4698
self .executeCheck (2210 , self .misra_22_10 , cfg )
4699
+ self .executeCheck (2306 , self .misra_23_6 , cfg )
4681
4700
4682
4701
def read_ctu_info_line (self , line ):
4683
4702
if not line .startswith ('{' ):
0 commit comments