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

Re: Bug#107081: PowerPC: reuse same va_list more that once failed



> > But it'll come up again. This isn't the first time I've seen these varargs
> > bugs. My most confusing one involved setjmp/longjmp to achieve the va_list
> > reuse :-)
>
> Should be possible to have a GCC warning when same va_list was used more
> that once as in vlog_and_print() ?

Nope. You could easily write code that takes the arg list in some known
state (say the first three arguments have been processed already), and
calls multiple instances of vsprintf with the remaining args, again
processing only part of the arg list until it is exhausted.

This is C: you can shoot yourself in the foot in an infinite number of
ways, all legal.

	Michael



Reply to: