diff --git a/addons/misra.py b/addons/misra.py index 99db65efc..a1bc019ef 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -2302,6 +2302,8 @@ class MisraChecker: continue if not token.isArithmeticalOp: continue + if not is_composite_expr(token): + continue parent = token.astParent if parent is None: continue diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c index 9e81ff854..a438b78d0 100644 --- a/addons/test/misra/misra-test.c +++ b/addons/test/misra/misra-test.c @@ -736,6 +736,7 @@ static void misra_10_6_1(uint32_t *a, uint16_t b, uint16_t c) *a = b + c ; // 10.6 } +static void misra_10_7_f1(struct Timer *pSelf, uint32_t interval_ms); static void misra_10_7(uint16_t u16a, uint16_t u16b) { uint32_t u32a = 100u; res = u32a * u16a + u16b; // 12.1 no-warning @@ -744,6 +745,7 @@ static void misra_10_7(uint16_t u16a, uint16_t u16b) { res = u32a * (u16a + u16b); // 10.7 u32a *= u16a + u16b; // 10.7 u32a = ((uint32_t)4 * (uint32_t)2 * (uint32_t)4 ); // no-warning (#10488) + dostuff(&t, (2*60*1000)); // no-warning } static void misra_10_8(u8 x, s32 a, s32 b) {