I am using a macro defined in the same source file as:
#define MY_MACRO (a, b,...) (...)
The macro is being used later in the file.
However, the compiler complains:
error: a undeclared (first use in this function).
It's really weird.. am I missing something obvious?
I think the problem is that there is a SPACE between MY_MACRO
and (a, b, ...)
. It should be like this:
#define MY_MACRO(a, b,...) (...)
Remove the space between the macro name and the argument list. The space separates the macro head from the body, so it is being treated as a macro with no arguments that expands into the desired argument list followed by the desired body.
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