|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH v2 52/60] json: Eliminate lexer state IN_WHITESPACE, pseudo-token JSON_SKIP |
Date: | Mon, 20 Aug 2018 13:38:55 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 08/20/2018 06:51 AM, Markus Armbruster wrote:
Hmm, if we did this: [IN_START_INTERPOL] { ['%'] = IN_INTERPOL, ['\t'] = IN_START_INTERPOL, ... } for similarity with all our other constructs, will gcc remember that we've already initialized other members not listed in the clause before, or will it mistakenly re-0-initialize the array members not mentioned?Fails make check. (gdb) p json_lexer[IN_START_INTERPOL] $1 = "\000\000\000\000\000\000\000\000\000\016\016\000\000\016", '\000' <repeats 18 times>, "\016\000\000\000\000\035", '\000' <repeats 217 times>
And thus answered my question - abbreviating causes gcc to re-zero-initialize any unmentioned members, so your override has to be one member at a time, as originally written.
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |