Macro with variable number of arguments

I’ve a compilation problem with the following simple MACRO

more dummy.c

#include <stdio.h>
#include <stdlib.h>

#define debug_clark(format, …) fprintf (stderr, format, ## VA_ARGS)


int main()
{
char var1[3]=“ab”;
int var2 = 5;

debug_clark("%s %d\n", var1, var2);
debug_clark(“ok\n”);

return 0;
}


The compilation with gcc and icc is ok, on the contrary the compilation with pgcc return the following error

pgcc -Minform=warn -c -o dummy.o dummy.c
PGC-S-0037-Syntax error: Recovery attempted by deleting ‘,’ (dummy.c: 13)
PGC/x86 Linux 7.1-6: compilation completed with severe errors

Can you give me a solution?
Many tanks
BC

Hi,

Thank you for reporting a problem to us. This is a bug and I have filed a TPR #14803 for it.

Hongyon