Abraxas/Misra Home  Table of Contents

Module - m106.html

ABRAXAS SOFTWARE - CodeCheck MISRA Test-Suite Misra-C:1998 Misra-C:2004.

Misra-C Test Suite for Module - m106.c

/* Misra C Enforcement Testing */

Misra C Enforcement Testing */

/* Rule 106: Required */

Rule 106: Required */

/* The address of an object with automatic storage shall not be */

The address of an object with automatic storage shall not be */

/* assigned to an object which may persist after the object has ceased */

assigned to an object which may persist after the object has ceased */

/* to exist. */

to exist. */
#include "misra.h"
int *pi;
int fk;
static SC_8 *
func106a ( void ) 



Function Name: func106a()

{
    

/* Returns pointer to automatic array. */

Returns pointer to automatic array. */
SC_8 text[100];
    return text; /*  RULE 106  */
    
}
static SC_8
func106b ( void ) 



Function Name: func106b()

{
    

/* Returns actual value. */

Returns actual value. */
SC_8 text = 'a';
    return text; 
    
}
static SC_8 *
func106c ( void ) 



Function Name: func106c()

{
    

/* Returns pointer to automatic. */

Returns pointer to automatic. */
SC_8 text;
SC_8 *pt=&text;
    return pt; /*  RULE 106  */
    
}
static SC_8 *
func106d ( void ) 



Function Name: func106d()

{
    

/* Returns pointer to static. */

Returns pointer to static. */
static SC_8 text;
SC_8 *pt=&text;
    return pt; 
    
}
static void
func106e ( void ) 



Function Name: func106e()

{
    
int k = 1;
    
    pi = ( &k ) ; /*  RULE 106  */
    
    pi = ( &fk ) ; 
    
}

Abraxas/Misra Home  Table of Contents

ABRAXAS SOFTWARE - CodeCheck MISRA Test-Suite Misra-C:1998 Misra-C:2004.