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

Method misra_11_6

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

Source from the content-addressed store, hash-verified

2776 self.reportError(token, 11, 5)
2777
2778 def misra_11_6(self, data):
2779 for token in data.tokenlist:
2780 if not isCast(token):
2781 continue
2782 vt1 = token.valueType
2783 vt2 = token.astOperand1.valueType
2784 if not vt1 or not vt2:
2785 continue
2786 if vt1.pointer == 1 and vt1.type == 'void' and vt2.pointer == 0 and token.astOperand1.getKnownIntValue() != 0:
2787 self.reportError(token, 11, 6)
2788 elif vt1.pointer == 0 and vt1.type != 'void' and vt2.pointer == 1 and vt2.type == 'void':
2789 self.reportError(token, 11, 6)
2790
2791 def misra_11_7(self, data):
2792 for token in data.tokenlist:

Callers

nothing calls this directly

Calls 3

reportErrorMethod · 0.95
getKnownIntValueMethod · 0.80
isCastFunction · 0.70

Tested by

no test coverage detected