From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9DEA9C433EF for ; Sat, 25 Sep 2021 12:13:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 139A861279 for ; Sat, 25 Sep 2021 12:13:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 139A861279 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:60142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU6YU-00021x-Mg for qemu-devel@archiver.kernel.org; Sat, 25 Sep 2021 08:13:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU6XE-0001BO-BT for qemu-devel@nongnu.org; Sat, 25 Sep 2021 08:12:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:35098) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU6XB-0000M1-5t for qemu-devel@nongnu.org; Sat, 25 Sep 2021 08:12:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632571919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=x0qDlty/TfgmwyShlWsF9KPlYPLsLmsMs+kiMkmN5iw=; b=aul+7l3SSsj6NdNoNcIxp9xAEvR+Tixx3E2lgEx+Kz3ZhC/gmHJxfCE7H5GyX7sHeBu5h8 lsCC6HIPdTK2ucYzTaqbfzFF/M9fCJ4cTkNm16FHd1J5CybqeeV87+3dmVb4FqGM9g8sO/ InT717G1GnMRv/QglrtHVxBBtHjaHMc= Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-258-Zf7nrlDvP5Gdn1o1nPjrgg-1; Sat, 25 Sep 2021 08:11:57 -0400 X-MC-Unique: Zf7nrlDvP5Gdn1o1nPjrgg-1 Received: by mail-pj1-f69.google.com with SMTP id d2-20020a17090a2a4200b001994a2b5092so12096946pjg.3 for ; Sat, 25 Sep 2021 05:11:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=x0qDlty/TfgmwyShlWsF9KPlYPLsLmsMs+kiMkmN5iw=; b=IbaK9Gac9MzHgnj/ZK+U6CezUIcHbuPeLhqcOfGGT84UgkTjBlJEXOXgfiHhMwltaO P6lL16b1siLlP3/VNw/CBRnBE4i4aM3ydj3idR3JeVbZTpQoNVaDYinlNSrGj6V+jMYa T5s/YGFsUV+wm6FNNFp9zjecqHgt8QZ9/9k9Q9hVus4T6HNLFfH8t+xShYcGlRqKJYGq qp5wuEqNev6G8yUoC8tvg3LJThD9HqT3kBwjU+nlYSe0BwH/AYBKNAifCU1l/YjdK7cG x2fSf08RXyX1FmzAZdXRccb3XsoaBGXBeKFo0z0gYnCkm+aiPbmuy5jKakggCipyR0XM 0EiA== X-Gm-Message-State: AOAM530Mc7FaJdodJfoYP97PFcAWod8IUm1k96S8PU+FJKcdRFAcYrtK ZfEaGhcqX5Y3C88LidbMp4Zy8VnT1LeOqjUpmMKv2oY4TOlYC8nT6F6+XsD1JOqC3uKBVZd9n+G qQ9dTzBCIbLPDH499kgBJmNYZSkxn0m8= X-Received: by 2002:a17:902:7ec2:b0:13d:b563:c39 with SMTP id p2-20020a1709027ec200b0013db5630c39mr13420619plb.14.1632571916248; Sat, 25 Sep 2021 05:11:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwP9s7T+QnxNLVTIX/M5NmB88/AqkWLyIO+nejCb03bRYq1ClXncGzLA18qfqlYQM/IcCuYevQshY0mnmkS2tE= X-Received: by 2002:a17:902:7ec2:b0:13d:b563:c39 with SMTP id p2-20020a1709027ec200b0013db5630c39mr13420605plb.14.1632571915947; Sat, 25 Sep 2021 05:11:55 -0700 (PDT) MIME-Version: 1.0 References: <20210724085453.16791-1-pbonzini@redhat.com> <20210724085453.16791-9-pbonzini@redhat.com> In-Reply-To: From: Paolo Bonzini Date: Sat, 25 Sep 2021 14:11:42 +0200 Message-ID: Subject: Re: [PULL 8/9] qapi: introduce forwarding visitor To: Peter Maydell Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000001eed3a05ccd0c5a1" Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.482, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Blake , QEMU Developers Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --0000000000001eed3a05ccd0c5a1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable El lun., 9 ago. 2021 12:40, Peter Maydell escribi=C3=B3: > Is it right, or is this its "looks like this is returning an error > indication" heuristic misfiring again ? > > My guess is the latter and it's caused by a mismatch > between the prototype of visit_optional() (returns a > status both by setting *present and in its return value) > and the Visitor::optional method (returns a status only > by setting *present, return void). I guess ideally we'd > standardize on whether these things were intended to return > a value or not. > Yeah, it's a false positive and the fix would be make Visitor::optional return a bool: if the visitor implements it, it's mandatory to overwrite *present, while non-input visitors (including the clone visitor) need not implement it at all and visit_optional will just return *present. Paolo > thanks > -- PMM > > --0000000000001eed3a05ccd0c5a1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


El lun., 9 ago. 2021 12:40, Peter Maydell <peter.maydell@linaro.org> escri= bi=C3=B3:
Is it right, or is this i= ts "looks like this is returning an error
indication" heuristic misfiring again ?

My guess is the latter and it's caused by a mismatch
between the prototype of visit_optional() (returns a
status both by setting *present and in its return value)
and the Visitor::optional method (returns a status only
by setting *present, return void). I guess ideally we'd
standardize on whether these things were intended to return
a value or not.

Yeah, it's a false positive and the fix would be make Vi= sitor::optional return a bool: if the visitor implements it, it's manda= tory to overwrite *present, while non-input visitors (including the clone v= isitor) need not implement it at all and visit_optional will just return *p= resent.

Paolo


thanks
-- PMM

--0000000000001eed3a05ccd0c5a1--