[previous] 2000 [next] No 'else' clause exists for this 'if' statement.
Control flow

No else clause has been encountered in this if statement. This style is not recommended in some programming standards. An else is considered important in the interests of logical completeness.

Note that message 2004 is generated instead for an if ... else if construct, when the final else clause is missing.

For example:


/*PRQA S 1-9999 ++*/
/*PRQA S 2000, 2004 --*/

extern void f2000 (int n)
{
    if (n < 10)             /* 2000 */
    {
      /* ... */
    }

    if (n < 10)
    {
      /* ... */
    }
    else if (n < 20)        /* 2004 */
    {
      /* ... */
    }
}


No MISRA-C:2004 Rules applicable to message 2000


See also:

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