Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MZXin-0006nU-Va for qemu-devel@nongnu.org; Fri, 07 Aug 2009 18:15:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MZXij-0006lG-4t for qemu-devel@nongnu.org; Fri, 07 Aug 2009 18:15:33 -0400 Received: from [199.232.76.173] (port=32822 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MZXij-0006lB-0h for qemu-devel@nongnu.org; Fri, 07 Aug 2009 18:15:29 -0400 Received: from lucius.provo.novell.com ([137.65.248.127]:4996) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MZXii-0001ma-4x for qemu-devel@nongnu.org; Fri, 07 Aug 2009 18:15:28 -0400 Message-Id: <4A7C531A020000480007DF91@lucius.provo.novell.com> Date: Fri, 07 Aug 2009 16:15:22 -0600 From: "Bruce Rogers" Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Avoid issue with pp-directive in macro List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org When building for SLES10, I ran into a build failure which results from = printf being a macro, and two files which have an #include preprocessing = directive within the macro arguments. There are other pp-directives,but = the #include was the only one causing problems. (This was with gcc 4.x = btw.) It is undefined behavior to include pp-directives within macro arguments, = and pretty much any of the std-c defined functions can be implemented as = macros, so this patch avoids the issue by ensuring we are not using the = macro version in the problematic cases. Signed-off-by: Bruce Rogers qemu-img.c | 2 +- vl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 070fe2e..581a908 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -58,7 +58,7 @@ static void format_print(void *opaque, const char *name) /* Please keep in synch with qemu-img.texi */ static void help(void) { - printf("qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 = Fabrice Bellard\n" + (printf)("qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 = Fabrice Bellard\n" "usage: qemu-img command [command options]\n" "QEMU disk image utility\n" "\n" diff --git a/vl.c b/vl.c index fdd4f03..0bea27f 100644 --- a/vl.c +++ b/vl.c @@ -4337,7 +4337,7 @@ static void version(void) static void help(int exitcode) { version(); - printf("usage: %s [options] [disk_image]\n" + (printf)("usage: %s [options] [disk_image]\n" "\n" "'disk_image' is a raw hard image image for IDE hard disk 0\n" "\n"