版面书写R-1-2-2强制

禁止 if、else if、else 省略大括号

未使用大括号
test.c
1void foo(int x)
2{
3 if (x == 2)
4 ;
禁止 if 省略大括号 [gjb8114-r-1-2-2]
5 else if (x == 3)
6 ;
禁止 else if 省略大括号 [gjb8114-r-1-2-2]
7 else
8 x = 0;
禁止 else 省略大括号 [gjb8114-r-1-2-2]
9}
使用大括号
test.c
1void foo(int x)
2{
3 if (x == 2)
4 {}
5 else if (x == 3)
6 {}
7 else
8 {
9 x = 0;
10 }
11}