如果找不到原型(prototype)的实现,VC 编译器会发出警告吗?
示例(注意不匹配的参数):
// calcSomething.h
int calcSomething(
int year,
int month,
int day,
int hour,
int minute,
int second
);
和
// calcSomething.cpp
int calcSomething(
int year,
int month,
int day
)
{
// ... implementation
}
更新:显然 G++ 有一个名为 -Wmissing-declarations
的开关,我认为它可能符合我的需要,但对于 VC++ 来说显然是这样。
最佳答案
看来答案是否定的。 MSVC 编译器没有等同于 G++ 的 -Wmissing-declarations 的选项。
关于c++ - Visual C++ 可以检查不匹配的原型(prototype)和实现吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21236710/