Community
Participate
Working Groups
In the following program... ========== #include <stdarg.h> void gmp_sscanf (va_list args, const char *fmt, ...){ va_start(args, fmt); //extract } int main() { va_list args; const char *fmt; gmp_sscanf(args,fmt); return 0; } ========== ...if you select the statement on line 3 and invoke the Extract Function refactoring, CDT produces the following code: ========== #include <stdarg.h> void extracted_function(va_list args, const char* fmt) { va_start(args, fmt); } void gmp_sscanf(va_list args, const char *fmt, ...) { extracted_function(args, fmt); } int main() { va_list args; const char *fmt; gmp_sscanf(args,fmt); return 0; } ========== va_start can only be used in a varargs function.