From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=58602 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq6W9-0003mo-EL for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:43:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq6W8-0004od-6l for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:43:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45600) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq6W7-0004oW-Ux for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:43:28 -0400 Message-ID: <4C7BD19C.9080308@redhat.com> Date: Mon, 30 Aug 2010 17:43:24 +0200 From: Jes Sorensen MIME-Version: 1.0 References: <1283182547-26116-1-git-send-email-Jes.Sorensen@redhat.com> <1283182547-26116-11-git-send-email-Jes.Sorensen@redhat.com> <4C7BD0CE.6020505@codemonkey.ws> In-Reply-To: <4C7BD0CE.6020505@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: kwolf@redhat.com, qemu-devel@nongnu.org On 08/30/10 17:39, Anthony Liguori wrote: > On 08/30/2010 10:35 AM, Jes.Sorensen@redhat.com wrote: >> From: Jes Sorensen >> >> This keeps the compiler happy when building with -Wextra while >> effectively generating the same code. >> >> Signed-off-by: Jes Sorensen >> > > What's GCC's compliant? cc1: warnings being treated as errors qjson.c: In function 'qobject_from_jsonv': qjson.c:39: error: missing initializer qjson.c:39: error: (near initialization for 'state.parser') make: *** [qjson.o] Error 1 We have a lot of these where we try to init a struct element {}. Yes it's technically legal. However it's painful when you try to apply more aggressive warning flags looking for real bugs. I would suggest we modify the coding style to ask people to not init a struct like this. Cheers, Jes