rakshi
rakshi

Reputation: 43

MISRA QACPP level 3 warning - Expression(s) with floating point type used as operand(s) to +=

I have code which has lot of floating point arithmetic, for example:

float32_value1 += float32_value2

This results in MISRA QACPP level 3 warning - Expression(s) with floating point type used as operand(s) to +=

Is there any workaround to resolve this warning other than suppressing it?

Thanks in advance!

Upvotes: 0

Views: 691

Answers (1)

Richard Corden
Richard Corden

Reputation: 21721

The MISRA rule in question is categorised as "Document". Rules in this category cannot be checked by analysis of the source code alone.

In this specific case the rule requires evidence that:

  • use of floating-point is the only option,
  • the team has the necessary knowledge,
  • an appropriate process is being followed

This information is not evident from the written source, however, adding a suppression with a reference to where that evidence exists is a possible approach to cover "Document" rules.

Upvotes: 1

Related Questions