examples/vhost: fix strict aliasing
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 9 Dec 2015 14:26:49 +0000 (14:26 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 9 Dec 2015 21:02:33 +0000 (22:02 +0100)
commit1befe9ca2484970a4bec6079763a524a23cd2306
tree6840a538780ae432276ba495de91d257605e2dba
parente281a8b610c329d3e62c44f5b7c4be3ce47897bb
examples/vhost: fix strict aliasing

Fixes following error on gcc 4.4.7:

examples/vhost/main.c: In function ‘new_device’:
rte_ring.h:740: error:
    dereferencing pointer ‘mbuf.486’ does break strict-aliasing rules
examples/vhost/main.c:1503: note: initialized from here
...
rte_ring.h:740: error:
    dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules
examples/vhost/main.c:1804: note: initialized from here

Fixes: d19533e8 ("examples/vhost: copy old vhost example")

Reported-by: Qian Xu <qian.q.xu@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Huawei Xie <huawei.xie@intel.com>
examples/vhost/main.c