Fixed #8562 (false positive: MISRA rule 20.13)
This commit is contained in:
parent
cc402869a6
commit
8f9fa2e6a7
|
@ -1496,10 +1496,9 @@ def misra_20_5(data):
|
|||
def misra_20_13(data):
|
||||
for directive in data.directives:
|
||||
dir = directive.str
|
||||
if dir.find(' ') > 0:
|
||||
dir = dir[:dir.find(' ')]
|
||||
if dir.find('(') > 0:
|
||||
dir = dir[:dir.find('(')]
|
||||
for sep in ' (<':
|
||||
if dir.find(sep) > 0:
|
||||
dir = dir[:dir.find(sep)]
|
||||
if dir not in ['#define', '#elif', '#else', '#endif', '#error', '#if', '#ifdef', '#ifndef', '#include',
|
||||
'#pragma', '#undef', '#warning']:
|
||||
reportError(directive, 20, 13)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "path\file.h" // 20.2
|
||||
#include /*abc*/ "file.h" // 20.3
|
||||
#include<file.h> // no warning
|
||||
#include <setjmp.h> // 21.4
|
||||
#include <signal.h> // 21.5
|
||||
#include <stdio.h> //21.6
|
||||
|
|
Loading…
Reference in New Issue