From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LGvd6-0002RZ-E9 for qemu-devel@nongnu.org; Sun, 28 Dec 2008 08:24:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LGvd4-0002Qp-MD for qemu-devel@nongnu.org; Sun, 28 Dec 2008 08:24:27 -0500 Received: from [199.232.76.173] (port=36324 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LGvd4-0002Qg-FU for qemu-devel@nongnu.org; Sun, 28 Dec 2008 08:24:26 -0500 Received: from mail-bw0-f12.google.com ([209.85.218.12]:33038) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LGvd3-0008E1-Rn for qemu-devel@nongnu.org; Sun, 28 Dec 2008 08:24:26 -0500 Received: by bwz5 with SMTP id 5so5266278bwz.10 for ; Sun, 28 Dec 2008 05:24:23 -0800 (PST) Message-ID: Date: Sun, 28 Dec 2008 15:24:22 +0200 From: "Blue Swirl" Subject: Re: [Qemu-devel] Fix compilation with -Werror=format-security In-Reply-To: <20081227200436.GK16751@xi.wantstofly.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20081227200436.GK16751@xi.wantstofly.org> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org On 12/27/08, Lennert Buytenhek wrote: > On Sat, Dec 27, 2008 at 07:52:39PM +0000, Frederik Himpe wrote: > > > Mandriva is now using the -Werror=format-security CFLAG by default. To > > make kvm 82 compile with this option, I had to apply this patch: > > http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/kvm/current/SOURCES/kvm-82-format-string.patch?view=co > > > diff -ur kvm-82.orig/qemu/monitor.c kvm-82/qemu/monitor.c > --- kvm-82.orig/qemu/monitor.c 2008-12-24 15:24:58.000000000 +0100 > +++ kvm-82/qemu/monitor.c 2008-12-27 20:19:32.000000000 +0100 > @@ -1975,7 +1975,7 @@ > > static void expr_error(const char *fmt) > { > - term_printf(fmt); > + term_printf("%s", fmt); > term_printf("\n"); > longjmp(expr_env, 1); > } > > Why not make this term_printf("%s\n", fmt); while you're at it? Thanks, I combined these to form r6134. As "fmt" no longer describes the parameter, I changed that to "msg".