3
我有我的代码如下声明:为什么我得到铛警告:没有以前的原型功能“差异”
//Central diff function, makes two function calls, O(h^2)
REAL diff(const REAL h, const REAL x, REAL (*func)(const REAL))
{
// diff = f(x + h) - f(x -h)/2h + O(h^2)
return ((*func)(x + h) - (*func)(x - h))/(2.0*h + REALSMALL);
}
这正好处于“utils.h”文件。当我编译一个测试使用它,它给了我:
clang++ -Weverything tests/utils.cpp -o tests/utils.o
In file included from tests/utils.cpp:4:
tests/../utils/utils.h:31:6: warning: no previous prototype for function 'diff' [-Wmissing-prototypes]
REAL diff(const REAL h, const REAL x, REAL (*func)(const REAL))
我在这里失踪?