Hi Pelle,
thanks for your excellent work.
Does the behavior of this code is correct?
#define TRIGGER_ZERO(...) 0
#define TEST_ZERO_CONCAT(...) TRIGGER_ZERO ##__VA_ARGS__()
#define TEST_ZERO_DIRECT(...) TRIGGER_ZERO __VA_ARGS__()
int _cdecl main(void) {
int i = 0;
i = TEST_ZERO_CONCAT(); //Ok, emit 0 with simple/no arguments
i = TEST_ZERO_CONCAT((void),foo); //emit '0,foo()' but expected warning #1058
i = TEST_ZERO_DIRECT(); //emit literal "TEST_ZERO_DIRECT()" and obvious linkage error
return 0;
}
I think this is a bug, TEST_ZERO_DIRECT() should generate 0, as do Clang and MinGW.
Thanks.