From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by dpdk.org (Postfix) with ESMTP id C9BBC20F for ; Sun, 8 Feb 2015 08:31:39 +0100 (CET) Received: by mail-wi0-f169.google.com with SMTP id ho1so1011660wib.0 for ; Sat, 07 Feb 2015 23:31:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=wZxEdQekRQvT2r2enu7QFxoWisqy+u4xDn6PNc1V0Rw=; b=ZnELuhu4U6xkIwBnuXhpY5v0PRuMj6sHagZG/i2wf+rUieZK/7vvF2lUkZ2jXGxOhd nSno5qNruaxPnMAiZDrFxER4TGWg7SR1gRmLnuEJeFbeUsMkqWBSj8S26PjIU2vRZiKG HK0FRW8PzyT/NwhfR5E2CRhe4FfcQRuYtO0pmuX8Lajo7kOLxpJ1jGvGUQFwzZksxUEQ eivAGY13H+n4WpXkwfX6mwOhCwj/+jgdi4DOd0BrscKWaX3mBwGU7Kf2qD6b8aMWZD81 3ztYsnjG6VGRA/gd83NyChv/qqbglw996RmOwEm9+E6ia8JB/IgA67VbN07BCnTY0bvL SB/w== X-Gm-Message-State: ALoCoQmYeMx+Pim5OEZYu9l0iizO8HeAdJ92H80Xb39KYidOmLron/w2zyWSOOR8MnmC4JmIE4a/ MIME-Version: 1.0 X-Received: by 10.180.97.2 with SMTP id dw2mr22106494wib.6.1423380699526; Sat, 07 Feb 2015 23:31:39 -0800 (PST) Received: by 10.27.51.13 with HTTP; Sat, 7 Feb 2015 23:31:39 -0800 (PST) In-Reply-To: <54D70343.6060502@luminatewireless.com> References: <54D5BD9F.7000902@luminatewireless.com> <20150207202349.GA7064@neilslaptop.think-freely.org> <54D70343.6060502@luminatewireless.com> Date: Sun, 8 Feb 2015 04:31:39 -0300 Message-ID: From: Ariel Rodriguez To: Ming Zhao Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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: Sun, 08 Feb 2015 07:31:40 -0000 "virtual" is a reserved word in c++. When the c++ compiler "g++" use that header in a "extern way (just generate standard typo for function identifiers)", there`s not way that the compiler posible "turn off" the "virtual" reserved word. If, for example, you guys use the "new" word ... its just the same as virtual. Regards. On Sun, Feb 8, 2015 at 3:33 AM, Ming Zhao wrote: > In fact the current rte_devargs.h header is enclosed inside extern C {} > block already. But it looks like it's not sufficient. Also there is also > the case that rte_devargs.virtual field could be accessed inside a cpp > file. > > On 02/07/2015 12:23 PM, Neil Horman wrote: > > 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 > > >