Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4097366imm; Wed, 5 Sep 2018 10:37:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaGtWwO40y5KGXirtuHgPciRcJQPsqo4lXu2VCUN0DYUgkmyftbIQr5fwOZivuNPmNziMME X-Received: by 2002:a62:9992:: with SMTP id t18-v6mr41272167pfk.239.1536169078803; Wed, 05 Sep 2018 10:37:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536169078; cv=none; d=google.com; s=arc-20160816; b=K1gZRJ0DgIotyAjTeYcx5n1F9c/WVElr1yEPmojVfWY0tHx/Epzwykf9cl1vqCTT6w 46a7owJFN2SjtxgiDjcBTlIDH4q9ruBJ/WSoF7u+R/gOAcC3Esj//wSJZEa3VchiGbcG Q5yZePy5sSK+tvBhR4cEgdWs8lsF16U0NCKHVmR4h0sNoMPBJILjR4xesOe5RQ+5O/8z bp+yGeDPHG7e5mkyfkf7zphhllPjcf3Si9QOuMRbMfv0SQNRCgzXgPef9DxXz4VmY1T6 FCMbZXPN8d/f2buPBCJ9Dz0HMSLa+aTArweetKATnN6xe2gpUz3+HHBkeYAe08G0tzF3 P/Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=rQvl2e641pJGOy7x3boXcnQSBzrLHMCPXyEDyXHWFMg=; b=T37RyesJ9MlhkalcQ+6cZ0zTzKPEpSxe/mmxBNB1MLPKsyFY24JvmaqmXcUKll8pja qGVoO6D0ZUWi0q/oIG1JGcw2zNbsiXxgIvpP/ldqDsflMMuFifYoe82FzDZRKIXZyfa1 1pA65HQEo5wtRdycPUUcSX7AdfTy2r0pQKXs6MmPTPOhURSMwbCIDuRLaOKFNBXnMrGb PaPnDYfxAB8ggEYzRa9ij+i2IIltvgyh9iEE5SctHMQxiBgJdFpqHwoVKl86Ae5yxSwo amkHMrGjtK/zNJUTlSD+3Fvt7Pmmz5C4h2BMB4vIZ9pxRQkVXDzxaH19bAk6f1u3Llu5 wc2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 35-v6si2553514pgz.453.2018.09.05.10.37.43; Wed, 05 Sep 2018 10:37:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727776AbeIEWGm (ORCPT + 99 others); Wed, 5 Sep 2018 18:06:42 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:37176 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726497AbeIEWGm (ORCPT ); Wed, 5 Sep 2018 18:06:42 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32CBC4021700; Wed, 5 Sep 2018 17:35:31 +0000 (UTC) Received: from redhat.com (ovpn-124-138.rdu2.redhat.com [10.10.124.138]) by smtp.corp.redhat.com (Postfix) with SMTP id 87082104949E; Wed, 5 Sep 2018 17:35:30 +0000 (UTC) Date: Wed, 5 Sep 2018 13:35:29 -0400 From: "Michael S. Tsirkin" To: David Howells Cc: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org, Jason Wang , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/11] UAPI: virtio_net: Fix use of C++ keywords as structural members Message-ID: <20180905125636-mutt-send-email-mst@kernel.org> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> <153616289529.23468.7498785670556620808.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <153616289529.23468.7498785670556620808.stgit@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 05 Sep 2018 17:35:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Wed, 05 Sep 2018 17:35:31 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 05, 2018 at 04:54:55PM +0100, David Howells wrote: > The virtio_net_ctrl_hdr struct uses a C++ keyword as structural members. Fix > this by inserting an anonymous union that provides an alternative name and > then hide the reserved name in C++. > > Signed-off-by: David Howells > cc: "Michael S. Tsirkin" > cc: Jason Wang > cc: virtualization@lists.linux-foundation.org > --- > > include/uapi/linux/virtio_net.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h > index a3715a3224c1..967142bc0e05 100644 > --- a/include/uapi/linux/virtio_net.h > +++ b/include/uapi/linux/virtio_net.h > @@ -150,7 +150,12 @@ struct virtio_net_hdr_mrg_rxbuf { > * command goes in between. > */ > struct virtio_net_ctrl_hdr { > - __u8 class; > + union { > +#ifndef __cplusplus > + __u8 class; > +#endif > + __u8 _class; > + }; > __u8 cmd; > } __attribute__((packed)); As long as you do not intend to use any classes, how about simply adding -Dclass=_class to your command line? Seems to work fine with gcc 8.1.1 on Fedora. -- MST