是否有可能编译pre-ANSI(K&安培; R式)C code用Visual C ++?

是否有可能编译pre-ANSI(K&安培; R式)C code用Visual C ++?

问题描述:

我们有一些旧的C code。与pre-ANSI(K&安培; R样式)函数声明。例如:

We have some old C code with pre-ANSI (K&R-style) function declarations. For example:

int foo(x, y)
double x, y;
{
    /* do some stuff */
}

有没有编译器开关,以便在Visual C ++ 2008支持这个功能?

Is there a compiler switch to enable support for this in Visual C++ 2008?

为了得到这个编译把code在.c文件与一个.cpp。这指示的Visual Studio编译code为C,而不是C ++

In order to get this to compile put the code in a .c file vs. a .cpp. This instructs Visual Studio to compile the code as C instead of C++