From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v2] examples/vhost: fix strict aliasing error on gcc 4.4.7 Date: Wed, 9 Dec 2015 10:32:11 +0000 Message-ID: <20151209103211.GA15104@bricha3-MOBL3> References: <1449573835-149947-1-git-send-email-pablo.de.lara.guarch@intel.com> <1449653999-55759-1-git-send-email-pablo.de.lara.guarch@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Pablo de Lara Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id D646B569C for ; Wed, 9 Dec 2015 11:32:15 +0100 (CET) Content-Disposition: inline In-Reply-To: <1449653999-55759-1-git-send-email-pablo.de.lara.guarch@intel.com> 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" On Wed, Dec 09, 2015 at 09:39:59AM +0000, Pablo de Lara wrote: > From: "De Lara Guarch, Pablo" >=20 > Fixes following error on gcc 4.4.7: >=20 > 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 =E2=80=98new_device=E2= =80=99: > /tmp/dpdk-tmp/x86_64-native-linuxapp-gcc/include/rte_ring.h:740: error: > dereferencing pointer =E2=80=98mbuf.486=E2=80=99 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 =E2=80=98({anonymous})=E2=80=99 does break st= rict-aliasing rules > /tmp/dpdk-tmp/examples/vhost/main.c:1804: note: initialized from here > make[1]: *** [main.o] Error 1 >=20 > Fixes: d19533e8 ("examples/vhost: copy old vhost example") >=20 > Reported-by: Qian Xu > Signed-off-by: Pablo de Lara > --- > Changes in v2: > - Remove unnecessary casting You've remove some, but not all unnecessary casting. You don't need a cas= t when assigning void * to any other type, so you can remove the mbuf casts too. /Bruce