misra.py: Fixed FN for rule 21.8

This commit is contained in:
orbitcowboy 2021-08-30 11:07:38 +02:00
parent 49df3d811a
commit 870b8b9c60
2 changed files with 2 additions and 1 deletions

View File

@ -3451,7 +3451,7 @@ class MisraChecker:
def misra_21_8(self, data):
for token in data.tokenlist:
if isFunctionCall(token) and (token.astOperand1.str in ('abort', 'exit', 'getenv')):
if isFunctionCall(token) and (token.astOperand1.str in ('abort', 'exit', 'getenv', 'system')):
self.reportError(token, 21, 8)
def misra_21_9(self, data):

View File

@ -1768,6 +1768,7 @@ static void misra_21_7(void) {
static void misra_21_8(void) {
abort(); // 21.8
(void)getenv("foo"); // 21.8
(void)system("cmd"); // 21.8
exit(-1); // 21.8
}