Abraxas/Misra Home  Table of Contents

Module - m71.html

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

Misra-C Test Suite for Module - m71.c

/* Misra C Enforcement Testing */

Misra C Enforcement Testing */

/* Rule 71: Required */

Rule 71: Required */

/* Functions shall always have prototype declarations and the */

Functions shall always have prototype declarations and the */

/* prototype shall be visible at both the function definition and the */

prototype shall be visible at both the function definition and the */

/* call. */

call. */
#include "misra.h"
SI_32 /*  RULE 71  */
rule71 ( SI_32 a ) 



Function Name: rule71()

{
    
SI_32 c;
    
    switch ( a ) 
    {
        
        case 0:
        case 1:
        c = 1;
        break;
        
        default:
        if ( a < 0 ) 
        {
            
            c = ( -1 ) ;
            
        }
        else
        {
            
            c = a * func71 ( a-1 ) ; /*  RULE 71  */
            
        }
        break;
        
    }
    
    return c;
    
}

Abraxas/Misra Home  Table of Contents

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