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

Method misra_11_7

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

Source from the content-addressed store, hash-verified

2789 self.reportError(token, 11, 6)
2790
2791 def misra_11_7(self, data):
2792 for token in data.tokenlist:
2793 if not isCast(token):
2794 continue
2795 vt1 = token.valueType
2796 vt2 = token.astOperand1.valueType
2797 if not vt1 or not vt2:
2798 continue
2799 if token.astOperand1.astOperand1:
2800 continue
2801 if (vt2.pointer > 0 and vt1.pointer == 0 and
2802 not vt1.isIntegral() and not vt1.isEnum() and
2803 vt1.type != 'void'):
2804 self.reportError(token, 11, 7)
2805 elif (vt1.pointer > 0 and vt2.pointer == 0 and
2806 not vt2.isIntegral() and not vt2.isEnum() and
2807 vt1.type != 'void'):
2808 self.reportError(token, 11, 7)
2809
2810 def misra_11_8(self, data):
2811 # TODO: reuse code in CERT-EXP05

Callers

nothing calls this directly

Calls 4

reportErrorMethod · 0.95
isIntegralMethod · 0.80
isEnumMethod · 0.80
isCastFunction · 0.70

Tested by

no test coverage detected