I was debbugging some code and found an interesting if condition which was not marked as an error while using pc-lint with MISRA2004.
static float32_t float_values[10u] = {0.0f};
if (float_values[FIXED_ARRAY_ENTRY])
{
/* Do stuff */
}
I do see a problem here, but this line actualy did what it should do. So my question is about understanding how the if statement evaluation works. My understanding would be, that the compiler will cast the condition content to an int value and if the float value is 1.0f or above, the code just works as intended.
And my second question would be, why did pc-lint not find this error.