Good afternoon,
I've been tasked with implementing code that seems to have been written for C99 in Visual Studio 2010. I've researched numerous C99/Visual Studio compatibility threads, but I haven't found anything relating to fixing my issue.
Basically, the code I have to port has function prototype and declaration written in the following way:
void myfunc(int, char*); //Prototype
void myfunc(variable1, pointer1) //Declaration
{
;//...
}
But Visual Studio 2010 is only willing to accept
void myfunc(int variable1, char* pointer1); //Prototype
void myfunc(int variable1, char* pointer1) //Declaration
{
;//...
}
I'm not 100% sure if this is even a C99 compatibility issue or some outdated coding practice, but the source file is being constatly updated by a third party and it's a requirement for me to avoid changing anything in it (such as renaming each single function), it is also a requirement for me to use visual studio 2010 because of a plug-in compiler. Is there an option that may allow this style of function declarations?
Thank you,
As far as I know MS VC++ does not support C99.
As for the function definition thsi definition
is invalid even for C89. After this header
and before the opening brace there shall be identifier declarations. If these declarations are present and you made simply a typo then you can use MS VC++ 2010. But you have to compile the code as C code.
According to the C Standard