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

Method misra_18_7

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

Source from the content-addressed store, hash-verified

3624 self.reportError(var.nameToken, 18, 5)
3625
3626 def misra_18_7(self, data):
3627 for scope in data.scopes:
3628 if scope.type != 'Struct':
3629 continue
3630
3631 token = scope.bodyStart.next
3632 while token != scope.bodyEnd and token is not None:
3633 # Handle nested structures to not duplicate an error.
3634 if token.str == '{':
3635 token = token.link
3636
3637 # skip function pointer parameter types
3638 if token.astOperand1 is None:
3639 pass
3640 elif cppcheckdata.simpleMatch(token, "[ ]"):
3641 self.reportError(token, 18, 7)
3642 break
3643 token = token.next
3644
3645 def misra_18_8(self, data):
3646 for var in data.variables:

Callers

nothing calls this directly

Calls 2

reportErrorMethod · 0.95
simpleMatchMethod · 0.80

Tested by

no test coverage detected