Abraxas/Misra Home  Table of Contents

Module - m34.html

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

Misra-C Test Suite for Module - m34.c

/* Misra C Enforcement Testing */

Misra C Enforcement Testing */

/* Rule 34: Required */

Rule 34: Required */

/* The operands of a logical && or || shall be primary expressions. */

The operands of a logical && or || shall be primary expressions. */
#include "misra.h"
SI_32
rule34 ( void ) 



Function Name: rule34()

{
    
SI_32 a = 3;
SI_32 b = 3;
SI_32 c = 3;
    
    if ( ( a == 3 ) && ( b == 3 ) ) 
    {
        
        c = 1;
        
    }
    
    if ( ( a == 3 ) || b ) 
    {
        
        c = 1;
        
    }
    
    if ( ( a == 3 ) || b == 3 ) /*  RULE 34  */
    {
        
        c = 1;
        
    }
    
    return c;
    
}

Abraxas/Misra Home  Table of Contents

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