diff --git a/addons/test/misra/misra-test.c b/addons/test/misra/misra-test.c index b415eb48b..50c835e48 100644 --- a/addons/test/misra/misra-test.c +++ b/addons/test/misra/misra-test.c @@ -234,10 +234,16 @@ void misra_9_5() { int x[] = {[0]=23}; // 9.5 } -void misra_10_1(uint8_t u) { +void misra_10_1(uint8_t u, char c1, char c2) { int32_t i; + char c; + enum { E1 = 1 }; i = 3 << 1; // 10.1 i = (u & u) << 4; // no-warning + c = c1 & c2; // FIXME: This is not compliant to "10.1". Trac #9489 + c = c1 << 1; // 10.1 + i = c1 > c2; // no-warning + i = E1 + i; // no-warning } void misra_10_4(u32 x, s32 y) { @@ -253,10 +259,11 @@ void misra_10_4(u32 x, s32 y) { z = (a == misra_10_4_A3) ? y : y; // no-warning } -void misra_10_6(u8 x, u32 a, u32 b) { +void misra_10_6(u8 x, u32 a, u32 b, char c1, char c2) { u16 y = x+x; // 10.6 u16 z = ~u8 x ;//10.6 u32 c = ( u16) ( u32 a + u32 b ); //10.6 + s32 i = c1 - c2; // FIXME: False positive for 10.6 (this is compliant). Trac #9488 } void misra_10_8(u8 x, s32 a, s32 b) {