Skip to content

Instantly share code, notes, and snippets.

@whitty
Created March 11, 2020 08:11
Show Gist options
  • Save whitty/8562d9f65b52c3437b681f3e277a8dca to your computer and use it in GitHub Desktop.
Save whitty/8562d9f65b52c3437b681f3e277a8dca to your computer and use it in GitHub Desktop.
Gives error: test.c:10:0: error: failed to expand 'LOGTRACE', it is invalid to use a preprocessor directive as macro parameter [preprocessorErrorDirective]
#include <stdio.h>
#define LOGTRACE(...) fprintf(stderr, __VA_ARGS__);
int main(void)
{
#ifdef ALT_FORMAT
LOGTRACE("abc %u def %u ghi %u\n",
#else
LOGTRACE("abcdefghi %u, %u, %u\n",
#endif
123, 456, 789);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment