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):
|
def misra_20_13(data):
|
||||||
for directive in data.directives:
|
for directive in data.directives:
|
||||||
dir = directive.str
|
dir = directive.str
|
||||||
if dir.find(' ') > 0:
|
for sep in ' (<':
|
||||||
dir = dir[:dir.find(' ')]
|
if dir.find(sep) > 0:
|
||||||
if dir.find('(') > 0:
|
dir = dir[:dir.find(sep)]
|
||||||
dir = dir[:dir.find('(')]
|
|
||||||
if dir not in ['#define', '#elif', '#else', '#endif', '#error', '#if', '#ifdef', '#ifndef', '#include',
|
if dir not in ['#define', '#elif', '#else', '#endif', '#error', '#if', '#ifdef', '#ifndef', '#include',
|
||||||
'#pragma', '#undef', '#warning']:
|
'#pragma', '#undef', '#warning']:
|
||||||
reportError(directive, 20, 13)
|
reportError(directive, 20, 13)
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include "path\file.h" // 20.2
|
#include "path\file.h" // 20.2
|
||||||
#include /*abc*/ "file.h" // 20.3
|
#include /*abc*/ "file.h" // 20.3
|
||||||
|
#include<file.h> // no warning
|
||||||
#include <setjmp.h> // 21.4
|
#include <setjmp.h> // 21.4
|
||||||
#include <signal.h> // 21.5
|
#include <signal.h> // 21.5
|
||||||
#include <stdio.h> //21.6
|
#include <stdio.h> //21.6
|
||||||
|
|
Loading…
Reference in New Issue