c89 gcc 4.7.4
I was just experimenting with macros like these:
#define LOG_INFO_1(fmt, ...) printf(fmt, __VA_ARGS__)
#define LOG_INFO_2(...) printf(__VA_ARGS__)
And using like this:
LOG_INFO_1("%s:%d", __func__, __LINE__);
LOG_INFO_2("%s:%d", __func__, __LINE__);
The output gives exactly the same format. I am just wondering what is the advantage of having the fmt
argument in my first macro? It doesn't seem to be really needed. How could I make use of it?