The C++ preprocessor of Oracle Solaris Studio 12.3 removes whitespace completely when expanding __VA_ARGS__
.
Can anybody confirm this behaviour on their system? Is it a known compiler bug? Are there any workarounds for this problem?
To illustrate, here is a simple test program, vaargs.c
:
#include <stdio.h>
#define PRINT(...) printf("%s\n", #__VA_ARGS__)
int main()
{
PRINT(hello world);
return 0;
}
The C preprocessor works as expected:
$ cc vaargs.c -o vaargs && ./vaargs
hello world
$ cc -V
cc: Sun C 5.12 SunOS_i386 2011/11/16
But the C++ preprocessor removes the space between "hello" and "world":
$ CC vaargs.c -o vaargs && ./vaargs
helloworld
$ CC -V
CC: Sun C++ 5.12 SunOS_i386 2011/11/16