misra.py: Rule 21.8, added missing exit() function.
This commit is contained in:
parent
bcae3ce9d4
commit
c39e3467a4
|
@ -1266,7 +1266,7 @@ def misra_21_7(data):
|
||||||
|
|
||||||
def misra_21_8(data):
|
def misra_21_8(data):
|
||||||
for token in data.tokenlist:
|
for token in data.tokenlist:
|
||||||
if isFunctionCall(token) and (token.astOperand1.str in {'abort', 'getenv', 'system'}):
|
if isFunctionCall(token) and (token.astOperand1.str in {'abort', 'exit', 'getenv', 'system'}):
|
||||||
reportError(token, 21, 8)
|
reportError(token, 21, 8)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -388,6 +388,7 @@ void misra_21_8() {
|
||||||
abort(); // 21.8
|
abort(); // 21.8
|
||||||
getenv("foo"); // 21.8
|
getenv("foo"); // 21.8
|
||||||
system(""); // 21.8
|
system(""); // 21.8
|
||||||
|
exit(-1); // 21.8
|
||||||
}
|
}
|
||||||
|
|
||||||
void misra_21_9() {
|
void misra_21_9() {
|
||||||
|
|
Loading…
Reference in New Issue