Modified rule 11.4 (#1252)
* Modified rule 11.4 * Made changes in isEnum() * Made suggested changes in isEnum()
This commit is contained in:
parent
8320be203d
commit
c511b3de20
|
@ -81,6 +81,10 @@ class ValueType:
|
|||
def isFloat(self):
|
||||
return self.type in {'float', 'double', 'long double'}
|
||||
|
||||
def isEnum(self):
|
||||
return self.typeScope and self.typeScope.type == "Enum"
|
||||
|
||||
|
||||
|
||||
class Token:
|
||||
"""
|
||||
|
|
|
@ -787,7 +787,9 @@ def misra_11_4(data):
|
|||
vt2 = token.astOperand1.valueType
|
||||
if not vt1 or not vt2:
|
||||
continue
|
||||
if vt1.pointer == 0 and vt2.pointer > 0 and vt2.type != 'void':
|
||||
if vt2.pointer > 0 and vt1.pointer == 0 and (vt1.isIntegral() or vt1.isEnum()) and vt2.type != 'void':
|
||||
reportError(token, 11, 4)
|
||||
elif vt1.pointer > 0 and vt2.pointer == 0 and (vt2.isIntegral() or vt2.isEnum())and vt1.type != 'void':
|
||||
reportError(token, 11, 4)
|
||||
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ void misra_10_4(u32 x, s32 y) {
|
|||
{
|
||||
;
|
||||
}
|
||||
z = x + y //10.4
|
||||
z = x + y; //10.4
|
||||
}
|
||||
|
||||
void misra_10_6(u8 x) {
|
||||
|
@ -172,6 +172,10 @@ void misra_11_3(u8* p) {
|
|||
|
||||
void misra_11_4(u8*p) {
|
||||
u64 y = (u64)p; // 11.4
|
||||
u8 *misra_11_4_A = ( u8 * ) 0x0005;// 11.4
|
||||
s32 misra_11_4_B;
|
||||
u8 *q = ( u8 * ) misra_11_4_B; // 11.4
|
||||
|
||||
}
|
||||
|
||||
void misra_11_5(void *p) {
|
||||
|
|
Loading…
Reference in New Issue