From c39e3467a43291fed05e338d9ca041c71d1a768e Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Wed, 9 May 2018 16:48:49 +0200 Subject: [PATCH] misra.py: Rule 21.8, added missing exit() function. --- addons/misra.py | 2 +- addons/test/misra-test.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/misra.py b/addons/misra.py index 83fc03b18..1896ccb56 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -1266,7 +1266,7 @@ def misra_21_7(data): def misra_21_8(data): 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) diff --git a/addons/test/misra-test.c b/addons/test/misra-test.c index e962de6b7..95ffe3f71 100644 --- a/addons/test/misra-test.c +++ b/addons/test/misra-test.c @@ -388,6 +388,7 @@ void misra_21_8() { abort(); // 21.8 getenv("foo"); // 21.8 system(""); // 21.8 + exit(-1); // 21.8 } void misra_21_9() {