Received: from [140.186.70.92] (port=47830 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P6Jys-0003Uw-1z for qemu-devel@nongnu.org; Thu, 14 Oct 2010 05:20:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P6Jyr-0001Xm-2C for qemu-devel@nongnu.org; Thu, 14 Oct 2010 05:20:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P6Jyq-0001Xg-R1 for qemu-devel@nongnu.org; Thu, 14 Oct 2010 05:20:09 -0400 From: Markus Armbruster References: Date: Thu, 14 Oct 2010 11:20:02 +0200 In-Reply-To: (Blue Swirl's message of "Wed, 13 Oct 2010 18:57:47 +0000") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [PATCH] Suppress warning: zero-length gnu_printf format string List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org Blue Swirl writes: > On Wed, Oct 13, 2010 at 7:19 AM, Markus Armbruster wr= ote: >> Blue Swirl writes: >> >>> On Mon, Oct 11, 2010 at 12:52 PM, Markus Armbruster = wrote: >>>> Warns about this line in check-qjson.c: >>>> =C2=A0 =C2=A0QObject *obj =3D qobject_from_json(""); >>>> >>>> The obvious fix (add -Wno-format-zero-length to gcc_flags) doesn't >>>> work, because -Wall switches it on again. =C2=A0Fix by putting configu= red >>>> flags last. >>> >>> This would disable the flag globally. I'd rather disable the flag only >>> for check-qjson.o >> >> Is this warning worth the hassle? =C2=A0What's the problem with empty fo= rmat >> strings? > > Your fix solves this specific case, but it also degrades the gcc > checks of the mainstream code (slightly). I think the test suite need > not follow the level of checking that should be applied to mainstream, > or at least the warnings there should not be fatal. "Degrade" implies we miss something that's "wrong" enough to be worth avoiding. What's wrong with empty format strings? >>> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 or more = generically, remove -Werror for checks. For >>> example, there could be a check for how we handle invalid formats and >>> then the sources would contain format strings that annoy GCC, but we >>> wouldn't want warnings from that to stop the build. >> >> If you want to go that extra mile, feel free. =C2=A0For me, --disable-we= rror >> has been good enough. > > In that case, we could ignore the warning, since the only reporter is > able to use a workaround ;-). > >> Regardless, I think we need the second patch hunk, to prevent -Wall from >> trampling over $gcc_flags. > > I'm fine with that part. Reposted separately.