I'm an intern student and my boss told me to do porting from Linux c to Visual C++.
When I built the coding, I found this error "unexpected in macro formal parameter list", here is the code
#define cache_info(format, msg...)
do { \
;\
} while (0)
I don't know what is wrong and what the coding is for .
I can't also ask the Linux programmer since he is out. Can someone help me ???
Sounds like your version of Visual C++ doesn't support variadic macros.
you might need to try something like this to get it to work.
#define FUNC(foo) ThisFunc foo
void ThisFunc(int, ...);
int main()
{
FUNC((123, 456));
}
or you could just be missing a comma?....
#define cache_info(format, msg,...)
I think that the problem could be from one of two things.
First, your macro is defined as
cache_info(format, msg...)
But you probably meant to write
cache_info(format, msg, ...)
Though this could just be a typo in your original post.
More importantly, though, macros with variable numbers of arguments ("variadic macros") are not supported in C++; they exist only in C. If you're trying to compile this C code with a C++ compiler, the compiler should give you an error here because the code isn't legal C++.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With