Community
Participate
Working Groups
In the following program... ========== #define F main() { int a,b,c; if (c==0) /* << extract */ #ifdef F /* these */ if(a==0) printf("a",a); /* five */ #else /* lines */ if(b==0) printf("b",b); /* >> */ #endif{} } ========== ...if you select lines 5 to 9 and invoke the Extract Function refactoring, CDT produces the following incorrect code: ========== #define F void extracted_function(int c, int a) { if (c == 0) /* << extract */ if (a == 0) printf("a", a); /* five */} main() { int a,b,c; extracted_function(c, a); #else /* lines */ if(b==0) printf("b",b); /* >> */ #endif{} } ========== The #else in main does not have any #if.