Abraxas/Misra Home  Table of Contents

Module - m40.html

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

Misra-C Test Suite for Module - m40.c

/* Misra C Enforcement Testing */

Misra C Enforcement Testing */

/* Rule 40: Advisory */

Rule 40: Advisory */

/* The sizeof operator should not be used on expressions that contain */

The sizeof operator should not be used on expressions that contain */

/* side effects. */

side effects. */
#include "misra.h"
SI_32
rule40 ( void ) 



Function Name: rule40()

{
    
SI_32 a = 3;
SI_32 c = 3;
volatile SI_32 v;
    
    if ( sizeof ( a++ ) == 4 ) /*  RULE 40  */
    {
        
        c = 1;
        
    }
    
    if ( sizeof ( v ) == 4 ) /*  RULE 40  */
    {
        
        c = 1;
        
    }
    
    if ( sizeof ( f (  ) ) == 4 ) /*  ????  */
    {
        
        c = 1;
        
    }
    
    return c;
    
}

Abraxas/Misra Home  Table of Contents

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