[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can anyone help with #112770?



> > The upshot is that powerpc compilers enforce the correct usage of
> > varargs, where most i386 compilers do not. It's not really a powerpc
> > specific problem.

In this case it's rather incorrect usage on PowerPC leading to disastrous
results, while you can get away with incorrect usage on other platforms
more easily. The compiler only enforces correct use of data types in
va_arg(). Improper reuse of va_list data isn't caught.

> Yep, and here is a patch, against the current sid source, untested, maybe
> someone should test this or rather redesign the interface relating to
> xvsprintf() and stuff. The manpage to vsnprintf() explicitly says that the
> va_list contains something undefined afterwards, so one cannot call it
> twice in a row without va_end(), va_start() in between.

Looks OK to me.

	Michael



Reply to: