MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / misra_20_13

Method misra_20_13

addons/misra.py:3895–3904  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

3893 break
3894
3895 def misra_20_13(self, data):
3896 dir_pattern = re.compile(r'#[ ]*([^ (<]*)')
3897 for directive in data.directives:
3898 dir = directive.str
3899 mo = dir_pattern.match(dir)
3900 if mo:
3901 dir = mo.group(1)
3902 if dir not in ['define', 'elif', 'else', 'endif', 'error', 'if', 'ifdef', 'ifndef', 'include',
3903 'pragma', 'undef', 'warning']:
3904 self.reportError(directive, 20, 13)
3905
3906 def misra_20_14(self, data):
3907 # stack for #if blocks. contains the #if directive until the corresponding #endif is seen.

Callers

nothing calls this directly

Calls 3

reportErrorMethod · 0.95
compileMethod · 0.80
matchMethod · 0.45

Tested by

no test coverage detected