Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC2012-Rule-21.12_b

In this section:
Synopsis

(Required) The exception handling features of <fenv.h> shall not be used.

Enabled by default

Yes

Severity/Certainty

Low/High

lowhigh.png
Full description

Macros are used in <fenv.h>.

Coding standards
MISRA C:2012 Rule-21.12

(Required) The exception handling features of <fenv.h> should not be used

Code examples

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

#include <fenv.h>

void example(void) {
  feclearexcept(FE_INEXACT);
}

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

#include <fenv.h>

void example(void) {
  /* including the header but not used its features */
}