From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N3hBQ-00007X-Ua for qemu-devel@nongnu.org; Thu, 29 Oct 2009 22:25:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N3hBM-0008To-7F for qemu-devel@nongnu.org; Thu, 29 Oct 2009 22:25:44 -0400 Received: from [199.232.76.173] (port=55723 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N3hBL-0008Te-W3 for qemu-devel@nongnu.org; Thu, 29 Oct 2009 22:25:40 -0400 Received: from mail2.shareable.org ([80.68.89.115]:50005) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N3hBL-0000wg-LH for qemu-devel@nongnu.org; Thu, 29 Oct 2009 22:25:39 -0400 Date: Fri, 30 Oct 2009 02:25:33 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: [PATCH 2/7] Introduce QError Message-ID: <20091030022533.GC20292@shareable.org> References: <1256841750-15228-1-git-send-email-lcapitulino@redhat.com> <1256841750-15228-3-git-send-email-lcapitulino@redhat.com> <4AE9F794.4030204@us.ibm.com> <20091029184834.4d6dd8a6@doriath> <4AEA125C.5040203@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4AEA125C.5040203@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Anthony Liguori , kraxel@redhat.com, hollisb@linux.vnet.ibm.com, Luiz Capitulino Paolo Bonzini wrote: > On 10/29/2009 09:48 PM, Luiz Capitulino wrote: > >> va_list doesn't need to be a pointer. > > > > Ok, but if this is going to be a public interface, I think it's > >better to va_copy() before passing it to qobject_from_json_va() then. > > It is standard to pass a va_list by value without doing va_copy in the > caller. That's right, just like: va_list ap; va_start(ap, format); vfprintf(stderr, format, ap); /* <- passed by value */ va_end(ap); You only need va_copy() is you're going to use some more it after passing it to the function. There should be one va_end() for every va_start() plus every va_copy(). -- Jamie