Misra: Add rule 20.3
This commit is contained in:
parent
79ef26d7a2
commit
c8d3cccc21
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <stdarg.h> // 17.1
|
#include <stdarg.h> // 17.1
|
||||||
#include "path\file.h" // 20.2
|
#include "path\file.h" // 20.2
|
||||||
|
#include /*abc*/ "file.h" // 20.3
|
||||||
|
|
||||||
typedef unsigned char u8;
|
typedef unsigned char u8;
|
||||||
|
|
||||||
|
|
|
@ -574,6 +574,14 @@ def misra_20_2(rawTokens):
|
||||||
reportError(token, 20, 2)
|
reportError(token, 20, 2)
|
||||||
break
|
break
|
||||||
|
|
||||||
|
def misra_20_3(rawTokens):
|
||||||
|
for token in rawTokens:
|
||||||
|
if not simpleMatch(token, '# include'):
|
||||||
|
continue
|
||||||
|
headerToken = token.next.next
|
||||||
|
if not headerToken or not (headerToken.str.startswith('<') or headerToken.str.startswith('"')):
|
||||||
|
reportError(token, 20, 3)
|
||||||
|
|
||||||
if '-verify' in sys.argv[1:]:
|
if '-verify' in sys.argv[1:]:
|
||||||
VERIFY = True
|
VERIFY = True
|
||||||
|
|
||||||
|
@ -642,6 +650,7 @@ for arg in sys.argv[1:]:
|
||||||
if cfgNumber == 1:
|
if cfgNumber == 1:
|
||||||
misra_20_1(data.rawTokens)
|
misra_20_1(data.rawTokens)
|
||||||
misra_20_2(data.rawTokens)
|
misra_20_2(data.rawTokens)
|
||||||
|
misra_20_3(data.rawTokens)
|
||||||
|
|
||||||
if VERIFY:
|
if VERIFY:
|
||||||
for expected in VERIFY_EXPECTED:
|
for expected in VERIFY_EXPECTED:
|
||||||
|
|
Loading…
Reference in New Issue