From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 396FD20F for ; Sat, 7 Feb 2015 21:23:59 +0100 (CET) Received: from [2001:470:8:a08:215:ff:fecc:4872] (helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.63) (envelope-from ) id 1YKBuy-0006Rw-Nz; Sat, 07 Feb 2015 15:23:57 -0500 Date: Sat, 7 Feb 2015 15:23:50 -0500 From: Neil Horman To: Ming Zhao Message-ID: <20150207202349.GA7064@neilslaptop.think-freely.org> References: <54D5BD9F.7000902@luminatewireless.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54D5BD9F.7000902@luminatewireless.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -2.9 (--) X-Spam-Status: No Cc: dev@dpdk.org Subject: Re: [dpdk-dev] "virtual" C++ keyword used in rte_devargs.h and causes compilation error in C++ X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Feb 2015 20:23:59 -0000 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