Abraxas/Misra Home  Table of Contents

Module - m33.html

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

Misra-C Test Suite for Module - m33.c

/* Misra C Enforcement Testing */

Misra C Enforcement Testing */

/* Rule 33: Required */

Rule 33: Required */

/* The right hand side of a && or || operator shall not contain */

The right hand side of a && or || operator shall not contain */

/* side-effects. */

side-effects. */

/* This is not automatically detectable statically in all cases but */

This is not automatically detectable statically in all cases but */

/* the following should exercise a tool. */

the following should exercise a tool. */
#include "misra.h"
extern SI_32 func33 ( void ) ;
SI_32
rule33 ( void ) 



Function Name: rule33()

{
    
SI_32 a = 3;
SI_32 b = 3;
SI_32 c = 3;
    
    if ( ( a == 3 ) && b++ ) /*  RULE 33  */
    {
        
        c = 1;
        
    }
    
    if ( ( a == 3 ) || b++ ) /*  RULE 33  */
    {
        
        c = 1;
        
    }
    
    if ( ( a == 3 ) || func33 (  ) ) /*  ????  */
    {
        
        c = 1;
        
    }
    
    return c;
    
}

Abraxas/Misra Home  Table of Contents

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