Abraxas/Misra Home  Table of Contents

Module - m58.html

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

Misra-C Test Suite for Module - m58.c

/* Misra C Enforcement Testing */

Misra C Enforcement Testing */

/* Rule 58: Required */

Rule 58: Required */

/* The break statement shall not be used ( except to terminate the */

The break statement shall not be used ( except to terminate the */

/* cases of a switch statement ) . */

cases of a switch statement ) . */
#include "misra.h"
SI_32
rule58 ( void ) 



Function Name: rule58()

{
    
SI_32 c = 3;
SI_32 i = 3;
    
    switch ( i ) 
    {
        
        case 1:
        case 2:
        case 3:
        break; 
        
        default:
        break; 
        
    }
    
    for ( i = 0; i < 10; ++i ) 
    {
        
        break; /*  RULE 58  */
        
    }
    
    while (  ( i++ ) < 100 ) 
    {
        
        break; /*  RULE 58  */
        
    }
    
    do
    {
        
        break; /*  RULE 58  */
        
    }
    while (  ( i++ ) < 200 ) ;
    
    return c;
    
}

Abraxas/Misra Home  Table of Contents

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