Closing braces MUST appear on the same column as the corresponding
opening brace.
The text between two braces MUST be indented by a fixed, homogeneous
amount of whitespace. This amount SHOULD be 2 or 4 spaces.
Opening braces SHOULD appear on the same column as the text
before. However, they MAY be shifted with a fixed offset after
control structures, in which case the closing brace MUST be shifted
with the same offset.
These are wrong:
if (x == 3)
{
foo3();
{
inner();
}
}
if (x == 3)
{
foo3();
{
inner();
}
}
if (x == 3)
{
foo3();
{
inner();
}
}
These are correct:
if (x == 3)
{
foo3();
{
inner();
}
}
if (x == 3)
{
foo3();
{
inner();
}
}
In C functions, the declaration part MUST be separated from
statements with one blank line. Note that when there are no
declarations, there MUST NOT be any blank line within a block.