From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd0XQ-0001O9-A8 for qemu-devel@nongnu.org; Thu, 04 Feb 2010 07:10:24 -0500 Received: from [199.232.76.173] (port=46437 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd0XP-0001No-Im for qemu-devel@nongnu.org; Thu, 04 Feb 2010 07:10:23 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd0XO-0002mC-PB for qemu-devel@nongnu.org; Thu, 04 Feb 2010 07:10:23 -0500 Received: from lo.gmane.org ([80.91.229.12]:33620) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd0XO-0002m4-EV for qemu-devel@nongnu.org; Thu, 04 Feb 2010 07:10:22 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Nd0XL-0005CE-9t for qemu-devel@nongnu.org; Thu, 04 Feb 2010 13:10:19 +0100 Received: from 93-34-208-53.ip51.fastwebnet.it ([93.34.208.53]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Feb 2010 13:10:19 +0100 Received: from pbonzini by 93-34-208-53.ip51.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Feb 2010 13:10:19 +0100 From: Paolo Bonzini Date: Thu, 04 Feb 2010 13:09:51 +0100 Message-ID: References: <201002041504.52626.sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit In-Reply-To: <201002041504.52626.sheng@linux.intel.com> Sender: news Subject: [Qemu-devel] Re: "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 02/04/2010 08:04 AM, Sheng Yang wrote: > Got this building failure: > > In file included from qemu-img.c:68: > qemu-img-cmds.h:22:1: error: unterminated argument list invoking macro > "printf" > cc1: warnings being treated as errors > qemu-img.c: In function ‘help’: > qemu-img.c:95: warning: statement with no effect > qemu-img.c:71: error: expected ‘;’ before string constant > qemu-img.c:95: error: expected statement before ‘)’ token > make: *** [qemu-img.o] Error 1 > > And git bisect figure out the commit: 84958305, "Enable _FORTIFY_SOURCE=2". > > And the code is here: > > 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" > "Command syntax:\n" > #define DEF(option, callback, arg_string) \ > " " arg_string "\n" > #include "qemu-img-cmds.h" > #undef DEF > #undef GEN_DOCS > .... > > Seems gcc take "printf" as a marco. I added a "#undef printf" before the line, > then it works... It's glibc, not gcc. I suggest moving the help message into a variable and changing the printf to "fputs (help_msg, stdout);". Would you make a patch? Paolo