MISRAC2012-Rule-21.4
In this section:
Synopsis
(Required) The standard header file setjmp.h shall not be used
Enabled by default
Yes
Severity/Certainty
Low/Medium

Full description
Found uses of setjmp.h. This check is identical to MISRAC2004-20.7, MISRAC++2008-17-0-5.
Coding standards
- CERT ERR34-CPP
Do not use longjmp
- MISRA C:2004 20.7
(Required) The setjmp macro and the longjmp function shall not be used.
- MISRA C:2012 Rule-21.4
(Required) The standard header file <setjmp.h> shall not be used
- MISRA C++ 2008 17-0-5
(Required) The setjmp macro and the longjmp function shall not be used.
Code examples
The following code example fails the check and will give a warning:
#include <setjmp.h>
jmp_buf ex;
void example(void) {
setjmp(ex);
}
The following code example passes the check and will not give a warning about this issue:
void example(void) {
}