For the record, this invokes gcc in a mode which does not conform to
any standard. And your output is different from mine in default and
conforming modes, in that my output includes location information and
blank lines.
There is no general answer for this. Obviously
 #define R(x) p_B
would expand to p_B, but if the B comes from a macro argument, either
it gets expanded, or it doesn't. Only recursive macro definitions --
which wouldn't help you -- can cause a partial macro expansion.
*If* you really, really, really need this, you may be best of using a
non-C text macro processor such as m4, but perhaps if you explain why
you want this, there's a better solution.
I'm just curious about this, and I think m4 would solve this problem.
You can ignore the following. Thank you for your answer.
==========
I'm using a lib, it defined macros like AA CLOCK_AA PORT_AA BB
CLOCK_BB and PORT_BB.
I want to write a file config.h, with a line "#define XX ...", and
with some other macros like CLOCK_XX and PORT_XX.
when I defines XX to AA, CLOCK_XX and PORT_XX becomes CLOCK_AA and
PORT_AA
when I defines XX to BB, CLOCK_XX and PORT_XX becomes CLOCK_BB and
PORT_BB
So if I'm using AA now and I want to change it to BB, I only need to
change the definition of XX.
Maybe I'm thinking in the way with bash's command eval.