Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd0sK-0004IR-5V for qemu-devel@nongnu.org; Thu, 04 Feb 2010 07:32:00 -0500 Received: from [199.232.76.173] (port=54894 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd0sI-0004IJ-OL for qemu-devel@nongnu.org; Thu, 04 Feb 2010 07:31:58 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd0sH-0005ZV-6t for qemu-devel@nongnu.org; Thu, 04 Feb 2010 07:31:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:62257) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd0sG-0005ZL-Po for qemu-devel@nongnu.org; Thu, 04 Feb 2010 07:31:57 -0500 From: Juan Quintela In-Reply-To: <201002041504.52626.sheng@linux.intel.com> (Sheng Yang's message of "Thu, 4 Feb 2010 15:04:52 +0800") References: <201002041504.52626.sheng@linux.intel.com> Date: Thu, 04 Feb 2010 13:31:32 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Sheng Yang Cc: "Kirill A. Shutemov" , Anthony Liguori , qemu-devel@nongnu.org Sheng Yang wrote: > Got this building failure: > > In file included from qemu-img.c:68:=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 > qemu-img-cmds.h:22:1: error: unterminated argument list invoking macro=20 > "printf"=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 > cc1: warnings being treated as errors > qemu-img.c: In function =E2=80=98help=E2=80=99: > qemu-img.c:95: warning: statement with no effect > qemu-img.c:71: error: expected =E2=80=98;=E2=80=99 before string constant > qemu-img.c:95: error: expected statement before =E2=80=98)=E2=80=99 token > make: *** [qemu-img.o] Error 1 > > And git bisect figure out the commit: 84958305, "Enable _FORTIFY_SOURCE= =3D2". > > And the code is here: > > printf("qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 Fa= brice=20 > 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,=20 > then it works... > > So any clue on what's happened and how to fix? > > GCC version is 4.1.2. I looks like that GCC + _FORTIFY_SOURCE=3D2 is broken on your platfrom. What is better, to remove the multi-line string (it appears that is the only one there) or to make a test to check that _FORTIFY_SOURCE works on platforms. Anthony, what do you preffer? Later, Juan.