当我编译下面的 C 程序时,我得到这个警告:
‘noreturn’ function does return
. 这是功能:
void hello(void){
int i;
i=1;
}
为什么会发生?对这个函数的所有调用都是hello();
编辑:完整的错误输出:
home.c: In function ‘hello’:
hhme.c:838:7: error: variable ‘i’ set but not used [-Werror=unused-but-set-variable]
home.c:840:1: error: ‘noreturn’ function does return [-Werror]
cc1: all warnings being treated as errors
make: *** [home.o] Error 1