[dpdk-dev] [PATCH v2] examples/vhost: fix strict aliasing error on gcc 4.4.7

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Wed Dec 9 11:52:35 CET 2015


Hi Huawei,

> -----Original Message-----
> From: Xie, Huawei
> Sent: Wednesday, December 09, 2015 10:45 AM
> To: De Lara Guarch, Pablo; dev at dpdk.org
> Cc: yuanhan.liu at linux.intel.com
> Subject: Re: [PATCH v2] examples/vhost: fix strict aliasing error on gcc 4.4.7
> 
> On 12/9/2015 5:40 PM, De Lara Guarch, Pablo wrote:
> > From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch at intel.com>
> >
> > 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 <qian.q.xu at intel.com>
> > Signed-off-by: Pablo de Lara <pablo.de.lara.guarch at intel.com>
> Acked-by: Huawei Xie <huawei.xie at intel.com>
> 

I am going to send a v3 for this patch, removing the other casting that Bruce mentioned.
I will pre-ack it, unless you have any concerns.

Thanks,
Pablo


More information about the dev mailing list