'how do macro operator ## and ... work together in C
I now trying to make a new flash driver for a specific chip which is not supported in openocd. Everything went well until I suddenly met the following code:
/**
* Command handlers may be defined with more parameters than the base
* set provided by command.c. This macro uses C99 magic to allow
* defining all such derivative types using this macro.
*/
#define CALL_COMMAND_HANDLER(name, extra ...) \
name(cmd, ## extra)
I looked up in C Primer Plus and I know ... is for variadic macro and ## is for gluing. However, I cannot understand how it comes to the code I mentioned before.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
