【发布时间】:2013-04-04 13:25:25
【问题描述】:
当我编译下面的 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
【问题讨论】:
-
能否请您创建一个SSCCE 并向我们展示一个完整的示例?还请包括all 和complete 错误/警告消息。
-
你用的是什么编译器?您使用了哪些编译器选项?
标签: c gcc compiler-errors warnings compiler-warnings