From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by dpdk.org (Postfix) with ESMTP id 22E441F7 for ; Sun, 8 Feb 2015 07:33:42 +0100 (CET) Received: by mail-pa0-f52.google.com with SMTP id ey11so2249255pad.11 for ; Sat, 07 Feb 2015 22:33:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ejYMpB1SfI0AC+A086vtXgzWnh58s+JDVwqvFkeYHPk=; b=RVYor391OSv7WAHubLel3t8THHOzIMsdOMzYtjr4QTKxCvqJk/GVU+vpxEqFfG9rZ4 VKUzrHAEOuIY+6cf60u0MTdEOwfgHoAj9js641vCB3W8mJ7fU0Osnzh86xIAXWtMp/r6 BwyQGQtJ/SXJJx5/lgOpOfnXH3250h3F6lt4tqHZL09bmsBHQzXjPM2Jp6fXWg9T19bt R3Bh066qqgth0wLBpD/cio9gZ8hD/CRzYaHr66nsfCrJmLMeXa8tKwQkFSLd7U02azFT rkbd7AU/B7eNWXjEa6G/m4BemJ/KHktPPX2jjxM+iKKrblh5yOcl2NS6b1I3n5tY7B/U fv6A== X-Gm-Message-State: ALoCoQnZbOrTJ0tnE33+/oyPKGUCOo6APW//phUtansvByrRAaGcNtMpUdiJQG+QaBGd/VQss6iT X-Received: by 10.67.5.226 with SMTP id cp2mr13834990pad.122.1423377221074; Sat, 07 Feb 2015 22:33:41 -0800 (PST) Received: from [192.168.1.192] ([50.174.17.220]) by mx.google.com with ESMTPSA id jp10sm12641824pbb.2.2015.02.07.22.33.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Feb 2015 22:33:40 -0800 (PST) Message-ID: <54D70343.6060502@luminatewireless.com> Date: Sat, 07 Feb 2015 22:33:39 -0800 From: Ming Zhao User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Neil Horman References: <54D5BD9F.7000902@luminatewireless.com> <20150207202349.GA7064@neilslaptop.think-freely.org> In-Reply-To: <20150207202349.GA7064@neilslaptop.think-freely.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 06:33:42 -0000 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 >