From nobody Fri Nov 7 14:38:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1548141399982274.3149729235454; Mon, 21 Jan 2019 23:16:39 -0800 (PST) Received: from localhost ([127.0.0.1]:39696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glqIQ-00079K-GI for importer@patchew.org; Tue, 22 Jan 2019 02:16:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1glqGv-0006NA-Nc for qemu-devel@nongnu.org; Tue, 22 Jan 2019 02:14:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1glqGs-0001oP-O6 for qemu-devel@nongnu.org; Tue, 22 Jan 2019 02:14:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47796) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1glqGs-0001Rf-AE for qemu-devel@nongnu.org; Tue, 22 Jan 2019 02:14:54 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84353A402E; Tue, 22 Jan 2019 07:08:42 +0000 (UTC) Received: from thuth.com (ovpn-116-54.ams2.redhat.com [10.36.116.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id A485419C7C; Tue, 22 Jan 2019 07:08:41 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Tue, 22 Jan 2019 08:08:35 +0100 Message-Id: <1548140916-6923-3-git-send-email-thuth@redhat.com> In-Reply-To: <1548140916-6923-1-git-send-email-thuth@redhat.com> References: <1548140916-6923-1-git-send-email-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 22 Jan 2019 07:08:42 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v4 20/26] virtio-net: Fix VirtIONet typedef redefinition X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 Commit 2974e916df8 introduced the VirtioNetRscChain structure which refer to a VirtIONet, declared later, thus required VirtIONet typedef to use a forward declaration. However, when compiling with Clang in -std=3Dgnu99 mode, this triggers the following warning/error: CC hw/net/virtio-net.o In file included from qemu/hw/net/virtio-net.c:22: include/hw/virtio/virtio-net.h:189:3: error: redefinition of typedef 'Vir= tIONet' is a C11 feature [-Werror,-Wtypedef-redefinition] } VirtIONet; ^ include/hw/virtio/virtio-net.h:110:26: note: previous definition is here typedef struct VirtIONet VirtIONet; ^ 1 error generated. make: *** [rules.mak:69: hw/net/virtio-net.o] Error 1 Fix it by removing the duplicate typedef definition. Reported-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Blake Reviewed-by: Greg Kurz Reviewed-by: Michael S. Tsirkin Signed-off-by: Thomas Huth --- include/hw/virtio/virtio-net.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h index c7ec1a7..bd66275 100644 --- a/include/hw/virtio/virtio-net.h +++ b/include/hw/virtio/virtio-net.h @@ -106,7 +106,6 @@ typedef struct VirtioNetRscSeg { NetClientState *nc; } VirtioNetRscSeg; =20 -struct VirtIONet; typedef struct VirtIONet VirtIONet; =20 /* Chain is divided by protocol(ipv4/v6) and NetClientInfo */ @@ -136,7 +135,7 @@ typedef struct VirtIONetQueue { struct VirtIONet *n; } VirtIONetQueue; =20 -typedef struct VirtIONet { +struct VirtIONet { VirtIODevice parent_obj; uint8_t mac[ETH_ALEN]; uint16_t status; @@ -186,7 +185,7 @@ typedef struct VirtIONet { int announce_counter; bool needs_vnet_hdr_swap; bool mtu_bypass_backend; -} VirtIONet; +}; =20 void virtio_net_set_netclient_name(VirtIONet *n, const char *name, const char *type); --=20 1.8.3.1