misra: fix fp for rule 3.1

This commit is contained in:
Daniel Marjamäki 2018-09-08 17:23:24 +02:00
parent 509cb35168
commit 18eff25c98
2 changed files with 4 additions and 2 deletions

View File

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

View File

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