On Wed, 9 Oct 2002, Brent Dax wrote:

> Andy Dougherty:
> # Overall, it continues to look very good.  Unfortunately, the 
> # compact-looking
> # 
> #     ch=va_arg((va_list)obj->data, char);
> # 
> # gave Sun's compiler indigestion.  I had to split it up into 
> # the much more pedestrian
> # 
> #      va_list arg;
> #      arg = (va_list) obj->data;
> #      ch = va_arg(arg, char);
> 
> Can you try putting the first code back in, but change the object call
> to be like this:
> 
>       ((va_list)(obj->data))
> 
> ?  I'm not sure yet, but this *may* be causing your other problems.

Duh, of course, va_list() can have side effects.  My fault.  Sorry.

Alas, your suggestion doesn't compile either, but I'll poke and prod
and see what I can do to make it compile.

Hmm.  Just removing the (va_list) cast makes both Sun's compiler and 
gcc happy.  (That's because va_list is ultimately typedef'd to void *
anyway under Solaris, and probably most other Unix systems.  I don't
know about elsewhere, so this could be tricky.)

Offhand, I'd say simply remove the (va_list) casts.  If that proves a
problem for some platform, I'll poke and prod around a bit and see if I
can fix things up.  I may end up doing something vaguely like
    va_list arg;
    arg = (va_list) obj->data;
    ch = va_arg(arg, char);
    obj->data = (void *) arg;

everywhere, though just removing the casts is easier if it works :-).

-- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to