Abraxas/Misra Home  Table of Contents

Module - m38.html

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

Misra-C Test Suite for Module - m38.c

/* Misra C Enforcement Testing */

Misra C Enforcement Testing */

/* Rule 38: Required */

Rule 38: Required */

/* The right hand operand of a shift operator shall lie between zero */

The right hand operand of a shift operator shall lie between zero */

/* and one less than the width in bits of the left hand operand */

and one less than the width in bits of the left hand operand */

/* ( inclusive ) . */

( inclusive ) . */
#include "misra.h"
SI_32
rule38 ( void ) 



Function Name: rule38()

{
    
UI_32 a = 3;
UI_32 b;
SI_32 c = 3;
    
    b = a >> ( -1 ) ; /*  RULE 38  */
    b = a << ( -1 ) ; /*  RULE 38  */
    
    b = a >> 32; /*  RULE 38  */
    b = a << 32; /*  RULE 38  */
    
    b = a >> 31; 
    b = a << 31; 
    
    return c;
    
}

Abraxas/Misra Home  Table of Contents

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