From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) by dpdk.org (Postfix) with ESMTP id C3819B47E for ; Fri, 20 Feb 2015 14:07:55 +0100 (CET) Received: by wesw55 with SMTP id w55so5504066wes.5 for ; Fri, 20 Feb 2015 05:07:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sO1bG8c2KicbUtGZnDiJwu3zhtZL37PscXCnHeAUB9Q=; b=xQsz9xeogw+Sy16kxEhkCKqRRMrzGsPvqlrAHVRuQh3xXTp3ZJhHca9slVgOiQ7CyB EsEAezBsFvtjIb0Y6iyrNHT056WsF1DLDUNkajHkXEuP8ps9SuyCFrDFwOFnifQ88893 cDhXrTTAZlIRV+Yu4p5MfqFw7zGKAZKf7pU7Nb61j0Fm32TPbltBoe4UJiJHf1KoUoO+ zWIFx3dFaiY42hJ6WCfcuPX8eE3czd13GdkNg6LBMzg3BKDugy57u3NHU21f9yjRqpsG yLJgIP/NIGunep4e7EJ1aQEIJNyUaZSTNPiy4F5AKA69CcNsjBt0eJpXnNEmAPtMOLky UsbQ== X-Received: by 10.180.21.161 with SMTP id w1mr19172694wie.44.1424437675549; Fri, 20 Feb 2015 05:07:55 -0800 (PST) Received: from spuiu-vm.anuesystems.local ([109.100.41.154]) by mx.google.com with ESMTPSA id fo8sm2332807wib.14.2015.02.20.05.07.53 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 20 Feb 2015 05:07:53 -0800 (PST) From: Stefan Puiu To: dev@dpdk.org Date: Fri, 20 Feb 2015 15:18:28 +0200 Message-Id: <1424438308-984-1-git-send-email-stefan.puiu@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 1/2] rte_pci.h: Fix C++11 compilation 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: Fri, 20 Feb 2015 13:07:56 -0000 In C++11 concatenated string literals need to have a space in between. Found with clang++-3.4, IIRC g++-4.8 also complains about this. Sample error message: 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 --- lib/librte_eal/common/include/rte_pci.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. */ #define PCI_FMT_NVAL 4 -- 1.7.9.5 >>From 12a4d5def7d35bc790b55da01bb9fc0b11e09340 Mon Sep 17 00:00:00 2001 From: Stefan Puiu Date: Fri, 20 Feb 2015 14:47:58 +0200 Subject: [PATCH 2/2] Headers: more C++11 compilation fixes Fixed two more places where non-C++11 string concatenation is used. Spotted by John McNamara. Signed-off-by: Stefan Puiu --- lib/librte_mempool/rte_mempool.h | 8 ++++---- lib/librte_vhost/vhost-net-cdev.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h index 3314651..48e9972 100644 --- a/lib/librte_mempool/rte_mempool.h +++ b/lib/librte_mempool/rte_mempool.h @@ -342,7 +342,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp, if (cookie != RTE_MEMPOOL_HEADER_COOKIE1) { rte_log_set_history(0); RTE_LOG(CRIT, MEMPOOL, - "obj=%p, mempool=%p, cookie=%"PRIx64"\n", + "obj=%p, mempool=%p, cookie=%" PRIx64 "\n", obj, mp, cookie); rte_panic("MEMPOOL: bad header cookie (put)\n"); } @@ -352,7 +352,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp, if (cookie != RTE_MEMPOOL_HEADER_COOKIE2) { rte_log_set_history(0); RTE_LOG(CRIT, MEMPOOL, - "obj=%p, mempool=%p, cookie=%"PRIx64"\n", + "obj=%p, mempool=%p, cookie=%" PRIx64 "\n", obj, mp, cookie); rte_panic("MEMPOOL: bad header cookie (get)\n"); } @@ -363,7 +363,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp, cookie != RTE_MEMPOOL_HEADER_COOKIE2) { rte_log_set_history(0); RTE_LOG(CRIT, MEMPOOL, - "obj=%p, mempool=%p, cookie=%"PRIx64"\n", + "obj=%p, mempool=%p, cookie=%" PRIx64 "\n", obj, mp, cookie); rte_panic("MEMPOOL: bad header cookie (audit)\n"); } @@ -372,7 +372,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp, if (cookie != RTE_MEMPOOL_TRAILER_COOKIE) { rte_log_set_history(0); RTE_LOG(CRIT, MEMPOOL, - "obj=%p, mempool=%p, cookie=%"PRIx64"\n", + "obj=%p, mempool=%p, cookie=%" PRIx64 "\n", obj, mp, cookie); rte_panic("MEMPOOL: bad trailer cookie\n"); } diff --git a/lib/librte_vhost/vhost-net-cdev.h b/lib/librte_vhost/vhost-net-cdev.h index 03a5c57..37e4ad2 100644 --- a/lib/librte_vhost/vhost-net-cdev.h +++ b/lib/librte_vhost/vhost-net-cdev.h @@ -55,9 +55,9 @@ char packet[VHOST_MAX_PRINT_BUFF]; \ \ if ((header)) \ - snprintf(packet, VHOST_MAX_PRINT_BUFF, "(%"PRIu64") Header size %d: ", (device->device_fh), (size)); \ + snprintf(packet, VHOST_MAX_PRINT_BUFF, "(%" PRIu64 ") Header size %d: ", (device->device_fh), (size)); \ else \ - snprintf(packet, VHOST_MAX_PRINT_BUFF, "(%"PRIu64") Packet size %d: ", (device->device_fh), (size)); \ + snprintf(packet, VHOST_MAX_PRINT_BUFF, "(%" PRIu64 ") Packet size %d: ", (device->device_fh), (size)); \ for (index = 0; index < (size); index++) { \ snprintf(packet + strnlen(packet, VHOST_MAX_PRINT_BUFF), VHOST_MAX_PRINT_BUFF - strnlen(packet, VHOST_MAX_PRINT_BUFF), \ "%02hhx ", pkt_addr[index]); \ -- 1.7.9.5