From: Neil Horman <nhorman@tuxdriver.com>
To: Ming Zhao <mzhao@luminatewireless.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] "virtual" C++ keyword used in rte_devargs.h and causes compilation error in C++
Date: Sat, 7 Feb 2015 15:23:50 -0500 [thread overview]
Message-ID: <20150207202349.GA7064@neilslaptop.think-freely.org> (raw)
In-Reply-To: <54D5BD9F.7000902@luminatewireless.com>
On Fri, Feb 06, 2015 at 11:24:15PM -0800, Ming Zhao wrote:
> The code is in rte_devargs.h:
>
> rte_devargs.h:
>
> /** Used if type is RTE_DEVTYPE_VIRTUAL. */
> struct {
> /** Driver name. */
> char drv_name[32];
> } virtual;
> };
>
> Which caused clang compiler to report error when this file is included
> by a cpp file, the error message is:
>
> In file included from net/dpdk/testing/base-test.cc:3:
> In file included from net/dpdk/testing/base-test.h:8:
> third-party/dpdk/lib/librte_eal/common/include/rte_devargs.h:89:5:
> error: 'virtual' can only appear on non-static
> member functions
> } virtual;
> ^
>
> I think we should try to pick another name for this field. I would
> suggest calling it "vdev" instead, or I'll be happy to take another name
> if someone comes with a different idea.
>
> Thanks!
> Ming
>
You could do that, but it seems like it shouldn't be necessecary. Shouldn't the
solution just be to encapsulate either the header file or the #include directive
from the C++ file with extern C { }?
Neil
next prev parent reply other threads:[~2015-02-07 20:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-07 7:24 Ming Zhao
2015-02-07 20:23 ` Neil Horman [this message]
2015-02-08 6:33 ` Ming Zhao
2015-02-08 7:31 ` Ariel Rodriguez
2015-02-08 13:53 ` Neil Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150207202349.GA7064@neilslaptop.think-freely.org \
--to=nhorman@tuxdriver.com \
--cc=dev@dpdk.org \
--cc=mzhao@luminatewireless.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).