Variable arguments in C macros on AIX
I am currently working on the recompilation of source code written on a Sequent Numa system to be run on an RS6000 AIX 5.2.
I have a problem with trying to convert some C code which attempts to use macros with variable arguments.
The problem is as. The following is a code fragment which when inserted into source code on the Sequent will compile and work correctly.
#define WDEBUG(format, args...) fprintf(stderr, "line %d: ", format "\n", '__LINE__' , ## args)
However when the same source code is compiled on the AIX it produces the following compilation error.
cc -c -g -DAIX -DTHREADSAFE -I/usr/iws/include -I../lib -DMYTYPE=906 -DLIVE=1 test.c
test.c", line 52.28: 1506-211 (S) Parameter list must be empty, or consist of one or more identifiers separated by commas.
As I'm not the author of the source code I'm not entirely sure what is being attempted here. But it seems to me that the Sequent can handle variable arguments in a macro where the AIX cannot.
I'd appreciate any help in finding a solution to this problem.
|