From patchwork Wed Dec 9 12:20:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "De Lara Guarch, Pablo" X-Patchwork-Id: 9433 Return-Path: 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 DA3B958D4; Wed, 9 Dec 2015 13:20:37 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 2C7D8569C for ; Wed, 9 Dec 2015 13:20:36 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 09 Dec 2015 04:20:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,403,1444719600"; d="scan'208";a="703560740" Received: from sie-lab-214-036.ir.intel.com (HELO sie-lab-214-174.ir.intel.com) ([10.237.214.36]) by orsmga003.jf.intel.com with ESMTP; 09 Dec 2015 04:20:33 -0800 From: Pablo de Lara To: dev@dpdk.org Date: Wed, 9 Dec 2015 12:20:30 +0000 Message-Id: <1449663630-83289-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1449659374-78252-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1449659374-78252-1-git-send-email-pablo.de.lara.guarch@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4] Fixes following error on gcc 4.4.7: 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" make: Entering directory `/tmp/dpdk-tmp/examples/vhost' CC main.o cc1: warnings being treated as errors /tmp/dpdk-tmp/examples/vhost/main.c: In function ‘new_device’: /tmp/dpdk-tmp/x86_64-native-linuxapp-gcc/include/rte_ring.h:740: error: dereferencing pointer ‘mbuf.486’ does break strict-aliasing rules /tmp/dpdk-tmp/examples/vhost/main.c:1503: note: initialized from here ... /tmp/dpdk-tmp/examples/vhost/main.c:1503: note: initialized from here /tmp/dpdk-tmp/x86_64-native-linuxapp-gcc/include/rte_ring.h:740: error: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules /tmp/dpdk-tmp/examples/vhost/main.c:1804: note: initialized from here make[1]: *** [main.o] Error 1 Fixes: d19533e8 ("examples/vhost: copy old vhost example") Reported-by: Qian Xu Signed-off-by: Pablo de Lara --- Changes in v4: - Simplify patch, just casting to void *, without using new variables Changes in v3: - Remove even more unnecessary castings Changes in v2: - Remove unnecessary casting examples/vhost/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index dc3a012..f3c50c5 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1500,7 +1500,7 @@ attach_rxmbuf_zcp(struct virtio_net *dev) } } while (unlikely(phys_addr == 0)); - rte_ring_sc_dequeue(vpool->ring, (void **)&mbuf); + rte_ring_sc_dequeue(vpool->ring, (void *)mbuf); if (unlikely(mbuf == NULL)) { LOG_DEBUG(VHOST_DATA, "(%"PRIu64") in attach_rxmbuf_zcp: " @@ -1801,7 +1801,7 @@ virtio_tx_route_zcp(struct virtio_net *dev, struct rte_mbuf *m, /* Allocate an mbuf and populate the structure. */ vpool = &vpool_array[MAX_QUEUES + vmdq_rx_q]; - rte_ring_sc_dequeue(vpool->ring, (void **)&mbuf); + rte_ring_sc_dequeue(vpool->ring, (void *)mbuf); if (unlikely(mbuf == NULL)) { struct vhost_virtqueue *vq = dev->virtqueue[VIRTIO_TXQ]; RTE_LOG(ERR, VHOST_DATA,