From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 09 Dec 2015 02:32:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,403,1444719600"; d="scan'208";a="837497264" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.63]) by orsmga001.jf.intel.com with SMTP; 09 Dec 2015 02:32:13 -0800 Received: by (sSMTP sendmail emulation); Wed, 09 Dec 2015 10:32:11 +0025 Date: Wed, 9 Dec 2015 10:32:11 +0000 From: Bruce Richardson To: Pablo de Lara 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1449653999-55759-1-git-send-email-pablo.de.lara.guarch@intel.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] examples/vhost: fix strict aliasing 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: , X-List-Received-Date: Wed, 09 Dec 2015 10:32:16 -0000 On Wed, Dec 09, 2015 at 09:39:59AM +0000, Pablo de Lara wrote: > From: "De Lara Guarch, Pablo" > > Fixes following error on gcc 4.4.7: > > 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 v2: > - Remove unnecessary casting You've remove some, but not all unnecessary casting. You don't need a cast when assigning void * to any other type, so you can remove the mbuf casts too. /Bruce