From 9b674fa3062927608728ac1ee405eb5788c94a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Mon, 8 Jul 2019 08:10:25 +0200 Subject: [PATCH] Revert "Add MISRA 18.4 check (#1966)" This reverts commit 3ff7ef091829835be19f268310ad5a10a392e7f4. --- addons/misra.py | 13 ------------- addons/test/misra-test.c | 14 -------------- 2 files changed, 27 deletions(-) diff --git a/addons/misra.py b/addons/misra.py index 585eb40fe..bec397672 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -1611,18 +1611,6 @@ class MisraChecker: if var and var.isArgument: self.reportError(token, 17, 8) - def misra_18_4(self, data): - for token in data.tokenlist: - if not token.str in ('+', '-', '+=', '-='): - continue - if token.astOperand1 is None or token.astOperand2 is None: - continue - vt1 = token.astOperand1.valueType - vt2 = token.astOperand2.valueType - if vt1 and vt1.pointer > 0: - self.reportError(token, 18, 4) - elif vt2 and vt2.pointer > 0: - self.reportError(token, 18, 4) def misra_18_5(self, data): for var in data.variables: @@ -2316,7 +2304,6 @@ class MisraChecker: self.misra_17_6(data.rawTokens) self.misra_17_7(cfg) self.misra_17_8(cfg) - self.misra_18_4(cfg) self.misra_18_5(cfg) self.misra_18_7(cfg) self.misra_18_8(cfg) diff --git a/addons/test/misra-test.c b/addons/test/misra-test.c index 82e90abcd..bf12361e0 100644 --- a/addons/test/misra-test.c +++ b/addons/test/misra-test.c @@ -503,20 +503,6 @@ void misra_17_8(int x) { x = 3; // 17.8 } -void misra_18_4() -{ - int b = 42; - int *bp = &b; - bp += 1; // 18.4 - bp -= 2; // 18.4 - int *p = bp - 2; // 18.4 - int *ab = &b + 1; // 18.4 - p = bp + p; // 18.4 - bp = 1 + p + 1; // 18.4 - b += 19; // no-warning - b = b + 9; // no-warning -} - void misra_18_5() { int *** p; // 18.5 }