25-06-2013, 02:34 PM
Hello,
As the rule 13.4 says : The controlling expression of a for statement shall not contain any objects of floating type.
But what about a function call with a float as parameter (example below) ?
I am asking this in order to implement a MISRA rule checker.
It seems correct to me since the float is not really use in the controlling expression. But the rules says any objects and that confuse me a little.
Thanks,
Ben
As the rule 13.4 says : The controlling expression of a for statement shall not contain any objects of floating type.
But what about a function call with a float as parameter (example below) ?
I am asking this in order to implement a MISRA rule checker.
Code:
int32_t i = 0;
float32_t float_var;
[...]
for (i = 0; i < float_to_int(float_var); ++i)
{
[...]
}
It seems correct to me since the float is not really use in the controlling expression. But the rules says any objects and that confuse me a little.
Thanks,
Ben