【发布时间】:2015-03-15 12:34:58
【问题描述】:
我在 C 中有一个简单的函数,它接受 int* 参数,并且我在头文件中声明了它,如下所示:
void mapAuditFioError(int *errno);
但编译器会按如下方式编译包含此标头的文件:
"warning: function declaration isn't a prototype"
还有:
"warning: passing argument 1 of 'mapAuditFioError' from incompatible pointer type"
即使我用一个整数指针本身来调用它。
浏览这个警告总是谈论这样的函数:int func() 实际上应该声明为int func(void)。但是我上面的函数有什么问题?
【问题讨论】:
标签: c compiler-warnings function-prototypes