TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - C Coding Standard
Search

SR:  9.5.1#1Checked automatically with code checker

This rule is Obsolete
Synopsis:A while statement must be followed by a {..} construct.
Language:C
Severity Level:6
Category:STATEMENTS


Description:
If only indentation is used to indicate that a single statement belongs to a while, it is a frequently occurring mistake to enhance this construct by adding another statement without supplying the now necessary {..} to indicate that both statements belong to the while. The practice of using {..} also aids readability.

Example:

  while( ... ) i++;   /* WRONG */ 

Example:

  while( ... )
  {
    i++;   /* RIGHT */
  }