I would like to know what ##
does in this macro definition:
#define debug(M, ...) fprintf(stderr,M "\n",##__VA_ARGS __)
I googled for an answer and I came up with the following.
The ##
will remove the comma if no variable arguments are given to the macro. So, if the macro is invoked like this
debug("message");
with no quotes, it is expanded to
fprintf(stderr,"message");
not
fprintf(stderr,"message",);
Why is the comma removed?