![]() |
|
MISRA-C:2004 Rule 15.3: (Required) |
|
||||
![]() | |||||||
Example Code:
#include "misra.h"
#include "m2cmex.h"
extern S16 test_1503( void )
{
S16 x = 0;
switch ( s16a )
{
case 0:
x = 2;
break;
case 1:
x = 1;
break;
} /* MISRA Violation */
switch ( s16b )
{
default: /* MISRA Violation */
x = 7;
break;
case 2:
x = 5;
break;
case 3:
++x;
break;
}
return x;
}
QAC messages that encompass this guideline:
| 2002 | No 'default' label found in this 'switch' statement. |
| 2009 | This 'default' label is not the final 'case' label within the 'switch' block. |
|
||
(c) The Motor Industry Research Association, 2004
|
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2 © 2013 Programming Research www.programmingresearch.com |
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |