[previous] 3352 [next] This 'switch' statement contains only two execution paths.
Switch statements REFERENCE - ISO:C90-6.6.4.2 The switch Statement

This switch statement contains only 2 branches. Would an "if ... else" construct would be more appropriate ?

For example:


/*PRQA S 3120,3227,3408,3447 ++*/

extern int x;

extern void foo(int n)
{
    switch (n)
    {
    case 5:
        ++x;
        break;

    default:
        x = 0;
        break;
    }                                   /* Message 3352 */
}


No MISRA C:2012 Rules applicable to message 3352


QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents