Why is this an issue?
<stdlib.h>
's abort
, exit
, getenv
, and system
have implementation-defined
behaviors, and should therefore be avoided.
Noncompliant code example
#include <stdlib.h>
void f( ) {
exit(0); // Noncompliant
}
Resources
- MISRA C:2004, 20.11 - The library functions abort, exit, getenv and system from library <stdlib.h> shall not be used.
- MISRA C++:2008, 18-0-3 - The library functions abort, exit, getenv and system from library <cstdlib> shall not be used.
- MISRA C:2012, 21.8 - The library functions abort, exit, getenv and system of <stdlib.h> shall not be used