Revert "Add MISRA 18.4 check (#1966)"

This reverts commit 3ff7ef0918.
This commit is contained in:
Daniel Marjamäki 2019-07-08 08:10:25 +02:00
parent 44ba9b5caf
commit 9b674fa306
2 changed files with 0 additions and 27 deletions

View File

@ -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)

View File

@ -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
}