Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rules 13.4 Function call with float
#1
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.

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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)