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

SR:  9.5.2#1Checked automatically with code checker

This rule is Obsolete
Synopsis:A for statement must be followed by a {..} construct even if only one statement is used.
Language:C
Severity Level:6
Category:STATEMENTS


Description:
If only indentation is used to indicate that a single statement belongs to a for, 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 for. The practice of using {..} also aids readability.

Example:

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

Example:

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