[previous] MISRA C:2012  Rule-21.8:  (Required) [next] The library functions abort, exit, getenv and system of <stdlib.h> shall not be used

Amplification:

The identifiers abort, exit, getenv and system shall not be used and no macro with one of these names shall be expanded.

Example Code:


#pragma PRQA_MESSAGES_OFF 2983

#include <stdlib.h>

#include "misra.h"
#include "m3cmex.h"

extern int16_t rule_2108( void )
{
   int16_t     i;
   char       *v;

   i = system( "test" );       /* 5126 */

   if ( i < -99 )
   {
      abort();                 /* 5126 */
   }

   if ( i == 40 )
   {
      exit( 1 );               /* 5126 */
   }

   v = getenv( "test" );       /* 5126 */

   return 0;
}


QAC messages that encompass this guideline:

5126 Use of function: abort, exit, getenv or system.



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