26-11-2012, 11:58 AM
Hey,
i have a problem with these 10.1 Rule:
MISRA says that a expression, which is a function argument, shouldn't be converted to a underlying type.
But i took a 8 bit value, expand to 32bit and use this for the function. The type of u32Convert is uint32_t as it should be for the function argument of foo_bar.
Is it neccessary to know what foo_bar does with the value?
Thanks for your help!
Greetz,
i have a problem with these 10.1 Rule:
Code:
void foo_bar(uint32_t u32) /* another function to do something */
void test_func(uint8_t u8)
{
uint32_t u32Convert = (uint32_t)u8;
...
foo_bar(u32Convert); /*Error - Note 960 Violates MISRA 2004 Required Rule 10.1, Prohibited Implicit Conversion: Non-constant argument to function */
...
}
But i took a 8 bit value, expand to 32bit and use this for the function. The type of u32Convert is uint32_t as it should be for the function argument of foo_bar.
Is it neccessary to know what foo_bar does with the value?
Thanks for your help!
Greetz,
<t></t>