Skip to main content

IAR Embedded Workbench for Arm 9.70.x

MISRAC2004-20.11

In this section:
Synopsis

(Required) The functions abort, exit, getenv, and system from the library stdlib.h shall not be used.

Enabled by default

Yes

Severity/Certainty

Low/Medium

lowmedium.png
Full description

Use of the functions abort, exit, getenv, or system was detected. This check is identical to MISRAC++2008-18-0-3, MISRAC2012-Rule-21.8.

Coding standards
MISRA C:2004 20.11

(Required) The functions abort, exit, getenv, and system from the library stdlib.h shall not be used.

MISRA C:2012 Rule-21.8

(Required) The library functions abort, exit, getenv and system of <stdlib.h> shall not be used

MISRA C++ 2008 18-0-3

(Required) The library functions abort, exit, getenv and system from library <cstdlib> shall not be used.

Code examples

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

#include <stdlib.h>

void example(void) {
  abort();
}

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

void example(void) {
}