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

Method misra_18_8

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

Source from the content-addressed store, hash-verified

3643 token = token.next
3644
3645 def misra_18_8(self, data):
3646 for var in data.variables:
3647 if not var.isArray or not var.isLocal:
3648 continue
3649 # TODO Array dimensions are not available in dump, must look in tokens
3650 typetok = var.nameToken.next
3651 if not typetok or typetok.str != '[':
3652 continue
3653 # Unknown define or syntax error
3654 if not typetok.astOperand2:
3655 continue
3656 if not isConstantExpression(typetok.astOperand2) and not isUnknownConstantExpression(typetok.astOperand2):
3657 self.reportError(var.nameToken, 18, 8)
3658
3659 def misra_19_2(self, data):
3660 for token in data.tokenlist:

Callers

nothing calls this directly

Calls 3

reportErrorMethod · 0.95
isConstantExpressionFunction · 0.85

Tested by

no test coverage detected