Re: Build-Conficts: gcc-3.3, and varargs
Justin Pryzby <email@example.com> writes:
> The code uses <varargs.h> which gcc-3.3 doesn't support. <stdarg.h> is
> the new standard. I've done my best to convert the code, but I can't
> solve a crash in the of the functions I had to change.
> See va_arg(3) for a reference. Here's what I did:
> - Comment out va_dcl
> - Change the va_alist parameter to "..."
> - Update the va_start calls to include the last parameter (all
> the functions have at least one constant argument).
> - Update the function prototypes.
That sounds right to me.
> If I read the code, it seems like there's something funky with the first
> variable argument. What I have for now is:
> -Tcl_AppendResult(Tcl_Interp *interp, char *p, va_alist)
> +void Tcl_AppendResult(Tcl_Interp *interp, ...)
> Can this be right (neglecting the char *p parameter)?
That would be very strange; that's not the usual way in which varargs
functions were used. However, it's always possible that the code in
question is particularly weird.
You don't include the code in question, so it's a bit hard to comment
without retrieving the whole source package and poking around, and I'm not
sure what segfaults you're getting or how they're produced. Is there a
fairly self-contained example that you know is segfaulting that you can
include? I've done varargs conversions before and have written a fair bit
of stdarg code, so maybe I can help.
Russ Allbery (firstname.lastname@example.org) <http://www.eyrie.org/~eagle/>