From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43292 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq7L1-0002Zx-Su for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:36:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq7L0-0005tc-Qb for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:36:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29259) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq7L0-0005tN-KU for qemu-devel@nongnu.org; Mon, 30 Aug 2010 12:36:02 -0400 Message-ID: <4C7BDDEE.8070706@redhat.com> Date: Mon, 30 Aug 2010 18:35:58 +0200 From: Paolo Bonzini MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy. References: <1283182547-26116-1-git-send-email-Jes.Sorensen@redhat.com> <1283182547-26116-11-git-send-email-Jes.Sorensen@redhat.com> <4C7BD16F.1030301@redhat.com> <4C7BD926.3030704@codemonkey.ws> <4C7BD9DE.8090102@redhat.com> <4C7BDC84.9070906@codemonkey.ws> In-Reply-To: <4C7BDC84.9070906@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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@redhat.com, qemu-devel@nongnu.org On 08/30/2010 06:29 PM, Anthony Liguori wrote: >> Arguably, an empty initializer should be special cased, but it >> isn't. > > So the warning is for old style initializer lists? I disagree that > it's a valid warning. First, {} is ambiguous as it can be an empty > list of c99 initializers and an empty list of c89 initializers. Yes, that's what I meant. {} should be special cased as an empty list will rarely be a bug, even when C89 initializers are used. > But even for c89 initializers, it's very common practice to omit > initializers and rely on the defaulted value. For instance, { 0 } is > quite pervasive as an idiom. That's why the warning is only in -Wextra. Those are warnings that may clash with someone's style conventions. Paolo