Skip to main content

IAR Embedded Workbench for RX 5.20

MISRAC++2008-5-0-5

In this section:
Synopsis

(Required) There shall be no implicit floating-integral conversions.

Enabled by default

Yes

Severity/Certainty

Low/Medium

lowmedium.png
Full description

One or more implicit floating-integral conversions were found.

Coding standards

This check does not correspond to any coding standard rules.

Code examples

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

void f()
{
  float f32;
  int s32;
  s32 = f32; // Non-compliant
}

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

void f()
{
  float f32;
  int s32;
  f32 = static_cast< float > ( s32 ); // Compliant 
}