From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52943 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq7os-0007NT-Sd for qemu-devel@nongnu.org; Mon, 30 Aug 2010 13:06:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq7or-0003nP-Ny for qemu-devel@nongnu.org; Mon, 30 Aug 2010 13:06:54 -0400 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:58330 helo=akado.ru) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq7or-0003nH-GM for qemu-devel@nongnu.org; Mon, 30 Aug 2010 13:06:53 -0400 Date: Mon, 30 Aug 2010 21:06:40 +0400 (MSD) From: malc Subject: Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy. In-Reply-To: <4C7BD2E7.2010201@codemonkey.ws> Message-ID: 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> <4C7BD19C.9080308@redhat.com> <4C7BD2E7.2010201@codemonkey.ws> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: kwolf@redhat.com, Jes Sorensen , qemu-devel@nongnu.org On Mon, 30 Aug 2010, Anthony Liguori wrote: > On 08/30/2010 10:43 AM, Jes Sorensen wrote: > > 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. > > > > No, this is GCC being stupid. Nonsense, it would have been stupid if it warned without asking for this warning, this is GCC being intelligent. [..snip..] -- mailto:av1474@comtv.ru