This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: variadic arguments not thread safe on amd64?


On Mon, Apr 27, 2009 at 8:37 PM, Matt Provost <mprovost@termcap.net> wrote:
> void tdebug(const char *format, ...) {
> Â Âva_list ap;
> Â Âpthread_mutex_lock(&m);
> Â Âmylog.format = format;
> Â Âva_start(ap, format);
> Â Âva_copy(mylog.ap, ap);
> Â Âpthread_cond_signal(&c);
> Â Âpthread_mutex_unlock(&m);

You are missing two va_end's here

-- Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]