[previous] MISRA-C:2004  Rule  20.7:  (Required) [next] The setjmp macro and the longjmp function shall not be used.
setjmp and longjmp allow the normal function call mechanisms to be bypassed, and shall not be used.

Example Code:


#include        <setjmp.h>

#include "misra.h"
#include "m2cmex.h"


extern S16 test_2007( void )
{
   S16     istat;
   jmp_buf myenv;

   istat = setjmp( myenv );            /* MISRA Violation */
   longjmp( myenv, 9 );                /* MISRA Violation */

   return istat;
}


QAC messages that encompass this guideline:

5122 The setjmp macro and the longjmp function shall not be used.



(c) The Motor Industry Research Association, 2004
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents