Coming very late to the party, but I had to get a word in.

Quoted from Gus Wirth [08 Jan 2005]:
> I started by just commenting out the code jhriv suggested. The compile got
> a lot further but stopped when referring to function that va_alist as one
> of the arguments. I checked in stdio.h and couldn't find it but there was a
> va_list in stdvar.h which is gcc specific, but there was no va_alist.

But you could use <stdarg.h>, which is standard and not gcc-specific.
va_alist is used in pre-ANSI code to represent the ellipses, because
the latter was introduced in ANSI.

Pre-ANSI variadic functions used this:

#include <varargs.h>

int
printf(format, va_alist)
    char *format;
    va_dcl
{
    va_list ap;
    int ret;

    va_start(ap);
    ret = vprintf(format, ap);
    va_end(ap);
    return ret;
}

ANSI uses this:

#include <stdarg.h>

int
printf(char const *format, ...)
{
    va_list ap;
    int ret;

    va_start(ap, format);
    ret = vprintf(format, ap);
    va_end(ap);
    return ret;
}

> So the only change I had to do was comment out the superfluous
> re-declarations and then make it use its own varg.h. I don't know how I
> would change this to make it cross-platform friendly (solaris, hp-ux, etc)
> but it works for me.

Or, just convert everything to use stdarg.h, and then it's really
portable...at least on systems that support ANSI, which I suppose
is most every system these days.

Cheers,
        ---Chris K.
-- 
 Chris, the Young One |_ If you can't afford a backup system, you can't
  Auckland, New Zealand |_ afford to have important data on your computer.
http://cloud9.hedgee.com/ |_ ---Tracy R. Reed
-- 

KPLUG-LPSG mailing list
[EMAIL PROTECTED]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to