Message ID | CACKs7VAXEvPy1qJi5nNTwO_gQcHifxcu1wBWo0Lqr_hZRj=iBA@mail.gmail.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id D274F5A74; Wed, 11 Feb 2015 09:50:59 +0100 (CET) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) by dpdk.org (Postfix) with ESMTP id BF5CE5A74 for <dev@dpdk.org>; Wed, 11 Feb 2015 09:50:58 +0100 (CET) Received: by iecat20 with SMTP id at20so2366345iec.12 for <dev@dpdk.org>; Wed, 11 Feb 2015 00:50:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=2IbsfwYxKANCZKThMsCwolR7w8gbbes7S+ECipd4xwU=; b=vOdyLacPp5RX/+534l4779xin07v6PKBuSZTrvjWWD2b+clrcoQ77sEzHpzyM9Chkj la9zYGZCuCE8d5nJoXrcs+BHGEyeZRNrOK7RdezeAEM7G9X51smaKsvvNVHh3K7lb7SF Cnlq3sYdrbdZlasvrLeSQKw5WPLXEOcWvl1fikjFdydS9SeRBuDEkuXyxloagw2VSxMx WD6VuswV6yKpVTNI0iwju0Q/I93juJHAEXax3GK5H0JOXiNFUzm5zYWHSjWNFR5zvSZ/ NDDFZX3SJNg7ZtcBWo7f6SZpy2XXTtHuknKSK6FzuROncJejOoNOf9oYV4rlKsfATE34 w4Gg== MIME-Version: 1.0 X-Received: by 10.107.136.24 with SMTP id k24mr22200723iod.59.1423644658146; Wed, 11 Feb 2015 00:50:58 -0800 (PST) Received: by 10.36.60.14 with HTTP; Wed, 11 Feb 2015 00:50:58 -0800 (PST) Date: Wed, 11 Feb 2015 10:50:58 +0200 Message-ID: <CACKs7VAXEvPy1qJi5nNTwO_gQcHifxcu1wBWo0Lqr_hZRj=iBA@mail.gmail.com> From: Stefan Puiu <stefan.puiu@gmail.com> To: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 Subject: [dpdk-dev] [PATCH] Minor C++11 compilation fix for rte_pci.h X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Stefan Puiu
Feb. 11, 2015, 8:50 a.m. UTC
In C++11 concatenated string literals need to have a space in between.
clang 3.4 reports this as an error (and IIRC also gcc-4.8):
dpdk/include/rte_pci.h:96:26: error: invalid suffix on literal; C++11
requires a space between literal and identifier
[-Wreserved-user-defined-literal]
Signed-off-by: Stefan Puiu <stefan.puiu@gmail.com>
---
lib/librte_eal/common/include/rte_pci.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
#define PCI_FMT_NVAL 4
Comments
> -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stefan Puiu > Sent: Wednesday, February 11, 2015 8:51 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] Minor C++11 compilation fix for rte_pci.h > > In C++11 concatenated string literals need to have a space in between. > clang 3.4 reports this as an error (and IIRC also gcc-4.8): > > dpdk/include/rte_pci.h:96:26: error: invalid suffix on literal; C++11 > requires a space between literal and identifier [-Wreserved-user-defined- > literal] Hi Stefan, That concatenated string literal with PRI* is used in 65 files in the DPDK source. Is that the only compilation error that you got? John
On Fri, Feb 13, 2015 at 08:25:38AM +0000, Mcnamara, John wrote: > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Stefan Puiu > > Sent: Wednesday, February 11, 2015 8:51 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH] Minor C++11 compilation fix for rte_pci.h > > > > In C++11 concatenated string literals need to have a space in between. > > clang 3.4 reports this as an error (and IIRC also gcc-4.8): > > > > dpdk/include/rte_pci.h:96:26: error: invalid suffix on literal; C++11 > > requires a space between literal and identifier [-Wreserved-user-defined- > > literal] > > Hi Stefan, > > That concatenated string literal with PRI* is used in 65 files in the DPDK source. Is that the only compilation error that you got? > > John It should only be a problem in header files. The C files for DPDK source are always to be compiled up with a C compiler - only the headers get included in application C++ code. /Bruce
> -----Original Message----- > From: Richardson, Bruce > Sent: Friday, February 13, 2015 10:18 AM > To: Mcnamara, John > Cc: Stefan Puiu; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH] Minor C++11 compilation fix for rte_pci.h > > > > > > > In C++11 concatenated string literals need to have a space in between. > > > clang 3.4 reports this as an error (and IIRC also gcc-4.8): > > > > > > dpdk/include/rte_pci.h:96:26: error: invalid suffix on literal; > > > C++11 requires a space between literal and identifier > > > [-Wreserved-user-defined- literal] > > > > > > That concatenated string literal with PRI* is used in 65 files in the > DPDK source. Is that the only compilation error that you got? > > > > John > > It should only be a problem in header files. The C files for DPDK source > are always to be compiled up with a C compiler - only the headers get > included in application C++ code. > Hi, In that case it only occurs in 3 header files. I guess that patch should be extended to include those as well: $ find lib -name \*.h | xargs grep -l '"PRI' lib/librte_vhost/vhost-net-cdev.h lib/librte_eal/common/include/rte_pci.h lib/librte_mempool/rte_mempool.h John. --
Hi and thanks for reviewing, I seem to have somehow missed the email for this one and thought it got lost. Sorry. On Fri, Feb 13, 2015 at 12:27 PM, Mcnamara, John <john.mcnamara@intel.com> wrote: >> -----Original Message----- >> From: Richardson, Bruce >> Sent: Friday, February 13, 2015 10:18 AM >> To: Mcnamara, John >> Cc: Stefan Puiu; dev@dpdk.org >> Subject: Re: [dpdk-dev] [PATCH] Minor C++11 compilation fix for rte_pci.h >> >> > > >> > > In C++11 concatenated string literals need to have a space in between. >> > > clang 3.4 reports this as an error (and IIRC also gcc-4.8): >> > > >> > > dpdk/include/rte_pci.h:96:26: error: invalid suffix on literal; >> > > C++11 requires a space between literal and identifier >> > > [-Wreserved-user-defined- literal] >> > >> > >> > That concatenated string literal with PRI* is used in 65 files in the >> DPDK source. Is that the only compilation error that you got? >> > >> > John >> >> It should only be a problem in header files. The C files for DPDK source >> are always to be compiled up with a C compiler - only the headers get >> included in application C++ code. >> > > Hi, > > In that case it only occurs in 3 header files. I guess that patch should be extended to include those as well: > > $ find lib -name \*.h | xargs grep -l '"PRI' > lib/librte_vhost/vhost-net-cdev.h > lib/librte_eal/common/include/rte_pci.h > lib/librte_mempool/rte_mempool.h Makes sense. Bruce is right, I'm only including headers from C++, the library is compiled using C. It seems I didn't hit the rte_mempool.h because (at least in 1.8.0) that the usage of PRI* is under #ifdef RTE_LIBRTE_MEMPOOL_DEBUG. It's very likely I didn't need the first file in the list. Anyway, I'll send a new version. > > John. > -- > > > >
diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 66ed793..12ae5a7 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -93,10 +93,10 @@ extern struct pci_device_list pci_device_list; /**< Global list of PCI devices. #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices" /** Formatting string for PCI device identifier: Ex: 0000:00:01.0 */ -#define PCI_PRI_FMT "%.4"PRIx16":%.2"PRIx8":%.2"PRIx8".%"PRIx8 +#define PCI_PRI_FMT "%.4" PRIx16 ":%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 /** Short formatting string, without domain, for PCI device: Ex: 00:01.0 */ -#define PCI_SHORT_PRI_FMT "%.2"PRIx8":%.2"PRIx8".%"PRIx8 +#define PCI_SHORT_PRI_FMT "%.2" PRIx8 ":%.2" PRIx8 ".%" PRIx8 /** Nb. of values in PCI device identifier format string. */