I guess what I'm trying to say is that a global replacement macro (like abc)
shouldn't depend on how the tokens came into existence, whether they were
typed in or the result of preprocessing.
Here's a variant of my original sample that works as expected:
#define append_c(X) X##c
#define prepend_a(X) a##X
#define invoke1(a,b) a(b)
#define aXc(X) invoke1(prepend_a,append_c(X))
#define abc append_c(abb)
int aXc(b) = 0; // appendc(ab) -> abc -> appendc(abb) -> abbc
int main(int argc, char *argv[])
{
return abbc;
}
$ gcc -E cppbug.c
# 1 "cppbug.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "cppbug.c"
int abbc = 0;
int main(int argc, char *argv[])
{
return abbc;
}
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]