Abraxas/Misra Home  Table of Contents

Module - m41.html

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

Misra-C Test Suite for Module - m41.c

/* Misra C Enforcement Testing */

Misra C Enforcement Testing */

/* Rule 41: Advisory */

Rule 41: Advisory */

/* The implementation of integer division in the chosen compiler */

The implementation of integer division in the chosen compiler */

/* should be determined, documented and taken into account. */

should be determined, documented and taken into account. */

/* This is not enforceable but there are some troublesome cases which */

This is not enforceable but there are some troublesome cases which */

/* are worth flagging if the static analyser is sufficiently */

are worth flagging if the static analyser is sufficiently */

/* sophisticated. */

sophisticated. */
#include "misra.h"
SI_32
rule41 ( void ) 



Function Name: rule41()

{
    
SI_32 a = 3;
SI_32 c = 3;
    
    a = 3 / -2; /*  RULE 41  */
    a = -3 / 2; /*  RULE 41  */
    a = 3%-2; /*  RULE 41  */
    a = -3%2; /*  RULE 41  */
    a /= -2; /*  RULE 41  */
    a %= -2; /*  RULE 41  */
    
    
    return c;
    
}

Abraxas/Misra Home  Table of Contents

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