c - GCC no longer implements -
I want to change the fragment of this code from varargs.h to stdarg.h, but I do not know how: / P>
#ifndef lint int ll_log (va_alist) va_dcl {int event, result; LLOP * LLP; Va_list AP; Va_start (AP); Lp = va_arg (AP, LogL *); Event = VA_arg (AP, int); Results = _ll_log (LP, Event, AP); Va_end (AP); Return result; } When I try to create it, the compiler says:
error "GCC is no longer applicable ;. " Error "Modify your code to use & lt; stdarg.h & gt ;." Programs that I need to compile and run have some similar pieces and I have to know how to change them. If you can write some examples, then I will have the content.
& lt; Varargs.h & gt; is a pre-standard C header; Instead of & lt; Stdarg.h & gt; Use difference: - The function must contain at least one named argument.
- The function must be prototype (using the alipesis terminator).
- The
va_start macro works differently: there are two arguments, the first one is to start va_list and the second name is the argument of the previous name is. Example:
int ll_log (LLO * log, ...) {ing event, results; LLOP * LLP; Va_list AP; Va_start (AP, Lowag); Lp = llog; Event = VA_arg (AP, int); Results = _ll_log (LP, Event, AP); Va_end (AP); Return result; } In relation to va_start : GCC ignores the second argument, but it is not portable by not giving it right.
Comments
Post a Comment