[previous] 2880 [next] This code is unreachable.
Control flow

This statement will never be executed. Perhaps this is the result of a mistake in some previous logic ?

For example:


/*PRQA S 2017,3120,3201,3227,3356,3359,3408 ++*/
int foo(int m)
{
    int r = 0;

    if (m > 10)
    {
        if (m < 5)               /* 2992 2996 */
        {         
            r = 1;               /* 2880      */ /* unreachable */
        }
    }

    return r;
}


MISRA C:2012 Rules applicable to message 2880:

Rule-2.1  (Required) A project shall not contain unreachable code


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