MISRAC2012-Rule-21.8
In this section:
Synopsis
(Required) The Standard Library termination functions of <stdlib.h> shall not be used.
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
Uses of abort, exit, getenv, and system were found. This check is identical to MISRAC2004-20.11, MISRAC++2008-18-0-3.
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) {
}