|
From: | Anthony Liguori |
Subject: | [Qemu-devel] Re: [PATCH 10/14] Zero json struct with memset() instea of = {} to keep compiler happy. |
Date: | Mon, 30 Aug 2010 10:39:58 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100713 Lightning/1.0b1 Thunderbird/3.0.6 |
On 08/30/2010 10:35 AM, address@hidden wrote:
From: Jes Sorensen<address@hidden> This keeps the compiler happy when building with -Wextra while effectively generating the same code. Signed-off-by: Jes Sorensen<address@hidden>
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);
[Prev in Thread] | Current Thread | [Next in Thread] |