Misra: Fix FP, rule 10.8

This commit is contained in:
Daniel Marjamäki 2017-04-17 08:44:30 +02:00
parent d6570b01e1
commit 196b530ede
2 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,7 @@ void misra_10_6(u8 x) {
}
void misra_10_8(u8 x) {
y = (u16)x;
y = (u16)(x+x); // 10.8
}

View File

@ -363,6 +363,8 @@ def misra_10_8(data):
continue
if not token.astOperand1.valueType or token.astOperand1.valueType.pointer>0:
continue
if not token.astOperand1.astOperand1:
continue
try:
intTypes = ['char', 'short', 'int', 'long', 'long long']
index1 = intTypes.index(token.valueType.type)