Received: from eggs.gnu.org ([2001:4830:134:3::10]:46659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYYs-0004VX-IL for qemu-devel@nongnu.org; Mon, 12 Oct 2015 04:34:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlYYp-00006Q-9A for qemu-devel@nongnu.org; Mon, 12 Oct 2015 04:34:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYYp-00006M-4u for qemu-devel@nongnu.org; Mon, 12 Oct 2015 04:34:23 -0400 From: Markus Armbruster References: <1443930073-19359-1-git-send-email-eblake@redhat.com> <1443930073-19359-11-git-send-email-eblake@redhat.com> <87fv1krv1m.fsf@blackfin.pond.sub.org> <5617D04F.6040904@redhat.com> Date: Mon, 12 Oct 2015 10:34:20 +0200 In-Reply-To: <5617D04F.6040904@redhat.com> (Eric Blake's message of "Fri, 9 Oct 2015 08:33:51 -0600") Message-ID: <874mhw7aer.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v7 10/14] qapi: Detect collisions in C member names List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Michael Roth , marcandre.lureau@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com Eric Blake writes: > On 10/09/2015 08:11 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Detect attempts to declare two object members that would result >>> in the same C member name, by keying the 'seen' dictionary off >>> of the C name rather than the qapi name. It also requires passing >>> info through some of the check() methods. >>> >>> This fixes two previously-broken tests, and the resulting error >>> messages demonstrate the utility of the .describe() method added >>> previously. No change to generated code. >>> >>> Signed-off-by: Eric Blake >>> > >>> +++ b/tests/qapi-schema/args-name-clash.err >>> @@ -0,0 +1 @@ >>> +tests/qapi-schema/args-name-clash.json:5: 'a_b' (member of oops >>> arguments) collides with 'a-b' (member of oops arguments) >> >> "(argument of oops)" would be better, but "(member of oops arguments)" >> will do. > > May be possible to tweak the describe() function in the previous commit > along those lines, especially since I'm already tweaking it to not have > space in the generated name. I'll have to play with it. At some point, implementation simplicity trumps error message polish. Use your judgement.