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 */ } |