分支控制R-1-4-1强制

禁止省略 if-else if 语句的 else 分支

省略 else 分支
test.c
1int foo(int x)
2{
3 if (x > 1)
4 {
5 return 1;
6 }
7 else if (x < -1)
8 {
9 return -1;
10 }
禁止省略 if-else if 语句的 else 分支 [gjb8114-r-1-4-1]
11 return x;
12}
包含 else 分支
test.c
1int foo(int x)
2{
3 if (x > 1)
4 {
5 return 1;
6 }
7 else if (x < -1)
8 {
9 return -1;
10 }
11 else
12 {
13 return x;
14 }
15}