From 18eff25c984f97c435d7621b5064537ccfc2f01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 8 Sep 2018 17:23:24 +0200 Subject: [PATCH] misra: fix fp for rule 3.1 --- addons/misra.py | 3 ++- addons/test/misra-test.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/misra.py b/addons/misra.py index a4aec481d..a8b691114 100755 --- a/addons/misra.py +++ b/addons/misra.py @@ -503,7 +503,8 @@ def isNoReturnScope(tok): def misra_3_1(rawTokens): for token in rawTokens: if token.str.startswith('/*') or token.str.startswith('//'): - if '//' in token.str[2:] or '/*' in token.str[2:]: + s = token.str.lstrip('/') + if '//' in s or '/*' in s: reportError(token, 3, 1) diff --git a/addons/test/misra-test.c b/addons/test/misra-test.c index 082e88d74..a3665f1a5 100644 --- a/addons/test/misra-test.c +++ b/addons/test/misra-test.c @@ -19,7 +19,8 @@ typedef unsigned int u32; typedef signed int s32; typedef unsigned long long u64; -//// 3.1 +// // 3.1 +//// extern int misra_5_1_extern_var_hides_var_x; extern int misra_5_1_extern_var_hides_var_y; //5.1