![]() |
|
MISRA-C:2004 Rule 15.5: (Required) |
|
||||
![]() | |||||||
switch(x){uint8_t var;/* not compliant - decl before 1st case */case0:a=b;break;/* break is required here */case1:/* empty clause, break not required */case2:a=c;/* executed if x is 1 or 2 */if(a==b){case3:/* Not compliant - case is not allowed here */}break;/* break is required here */case4:a=b;/* Not compliant - non empty drop through */case5:a=c;break;default:/* default clause is required */errorflag=1;/* should be non-empty if possible */break;/* break is required here, in case a future modification turns this into a case clause */}
QAC messages that encompass this guideline:
| 3315 | This 'switch' statement contains only a single path - it is redundant. |
|
||
(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 |