Misra: Add rule 17.6

This commit is contained in:
Daniel Marjamäki 2017-04-14 18:51:12 +02:00
parent 41e07c0614
commit f45a5ed29e
2 changed files with 7 additions and 2 deletions

View File

@ -175,4 +175,4 @@ void misra_16_7() {
}
}
void misra_17_6(int x[static 20]) {} // 17.6

View File

@ -9,7 +9,7 @@
# Limitations: This addon is released as open source. Rule texts can't be freely
# distributed. https://www.misra.org.uk/forum/viewtopic.php?f=56&t=1189
#
#
# Total number of rules: 153
import cppcheckdata
import sys
@ -502,6 +502,10 @@ def misra_17_1(rawTokens):
if simpleMatch(token, '# include <stdarg.h>'):
reportError(token, 17, 1)
def misra_17_6(rawTokens):
for token in rawTokens:
if simpleMatch(token, '[ static'):
reportError(token, 17, 6)
if '-verify' in sys.argv[1:]:
VERIFY = True
@ -563,6 +567,7 @@ for arg in sys.argv[1:]:
misra_16_7(cfg)
if cfgNumber == 1:
misra_17_1(data.rawTokens)
misra_17_6(data.rawTokens)
if VERIFY:
for expected in VERIFY_EXPECTED: