函数调用R-1-7-11强制

禁止忽略函数调用返回值而未加 (void)

非 void 函数的返回值可能会影响程序的执行结果,忽略时应显式地加上 (void) 说明

未加 (void) 说明的函数调用
test.c
1int foo(int x);
2
3void bar(void)
4{
5 foo(1);
禁止忽略函数调用返回值而未加 (void) [gjb8114-r-1-7-11]
6}
已加 (void) 说明的函数调用
test.c
1int foo(int x);
2
3void bar(void)
4{
5 (void)foo(1);
6}