From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=44835 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oq6Sp-0001fn-46 for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:40:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oq6Sn-0004E6-Pt for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:40:02 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:36358) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oq6Sn-0004Du-MP for qemu-devel@nongnu.org; Mon, 30 Aug 2010 11:40:01 -0400 Received: by qwh5 with SMTP id 5so5207465qwh.4 for ; Mon, 30 Aug 2010 08:40:01 -0700 (PDT) Message-ID: <4C7BD0CE.6020505@codemonkey.ws> Date: Mon, 30 Aug 2010 10:39:58 -0500 From: Anthony Liguori 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> In-Reply-To: <1283182547-26116-11-git-send-email-Jes.Sorensen@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Jes.Sorensen@redhat.com Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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? Regards, Anthony Liguori > --- > qjson.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/qjson.c b/qjson.c > index e4ee433..f259547 100644 > --- a/qjson.c > +++ b/qjson.c > @@ -36,8 +36,9 @@ static void parse_json(JSONMessageParser *parser, QList *tokens) > > QObject *qobject_from_jsonv(const char *string, va_list *ap) > { > - JSONParsingState state = {}; > + JSONParsingState state; > > + memset(&state, 0, sizeof(state)); > state.ap = ap; > > json_message_parser_init(&state.parser, parse_json); >