The code do the macro replacement is a mass, the big error looks like it is not the way a C Processor do the replacement.
For example, if we have such code
/****************************************/
#define A(x,y) (x+y)
#define B 1
#define C 2
#if A(B,C)
void f1234();
#endif
void f2345();
// f123 //f1234
// f234 //f2345
To expand the A(B,C), we should first apply the macro definition 1, so it becomes (B+C), then we should "rescan" the result token list, and finally get the (2+1), so the final result is 3.
But from my point of view, our Tokenizer don't have a "rescan" stage, the trick thing is that it did some text substitute on formal parameter to actual parameter translation, some kind of recursive call.
Note, with the latest cc-test frame, I get such result
-PASS: f234 f2345
*FAIL: f123 f1234
--------------------------------------------------------
Total 2 tests, 1 PASS, 1 FAIL
--------------------------------------------------------
So, the #if branch is abandoned.
EDIT:If I change the #if line to "#if A(2,3)", then I get two PASSes.
-PASS: f234 f2345
-PASS: f123 f1234
--------------------------------------------------------
Total 2 tests, 2 PASS, 0 FAIL
--------------------------------------------------------