Bug#590008: cpp-4.4: incorrect macro expansion when a macro call results in the same macro being called

2010-07-28 Thread Philip Ashmore
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 pr

Bug#590008: cpp-4.4: incorrect macro expansion when a macro call results in the same

2010-07-22 Thread pacman
Philip Ashmore writes: > > Package: cpp-4.4 > Version: 4.4.4-6 > Severity: normal > > Here's an example > > #define appendc(x) x##c > #define aXc(X) appendc(a##X) > #define abc appendc(abb) > > int aXc(b) = 0; // appendc(ab) -> abc -> appendc(abb) -> abbc > > int main(int a

Bug#590008: cpp-4.4: incorrect macro expansion when a macro call results in the same macro being called

2010-07-22 Thread Philip Ashmore
Package: cpp-4.4 Version: 4.4.4-6 Severity: normal Here's an example #define appendc(x) x##c #define aXc(X) appendc(a##X) #define abc appendc(abb) int aXc(b) = 0; // appendc(ab) -> abc -> appendc(abb) -> abbc int main(int argc, char *argv[]) { return abbc; }