Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC2012-Rule-10.1_R1

In this section:
Synopsis

(Required) Operands shall not be of an inappropriate essential type.

Enabled by default

Yes

Severity/Certainty

Medium/Medium

mediummedium.png
Full description

An expression of essentially floating type point type is used on a non-compliant operand.

Note: This check is not part of C-STAT® but detected by the IAR compiler.

Coding standards
MISRA C:2012 Rule-10.1

(Required) Operands shall not be of an inappropriate essential type

Code examples

The following code example fails the check and will give a warning:

float f() {
    float f = 1.0;
    if(f & 2U);
    return f << 2;
}

The following code example passes the check and will not give a warning about this issue:

float f() {
    float f1;
    float f2;
    return f1 + f2;
}