#define and expected primary-expression error

Viewed 1330

The following code causes "expected primary-expression before ‘)’ token" error when trying to compile it on Linux:

#define PRINTF(args, ...) printf((args), __VA_ARGS__)

void test( )
{
   PRINTF( "test" );
}

The same code works fine on Windows. I am not sure what the problem is.

Solution:

adding ## before __VA_ARGS__ solves the problem

1 Answers
Related