[ovs-dev] [PATCH 1/4] Add OF actions for generic encap and decap
Yang, Yi Y
yi.y.yang at intel.com
Fri Jul 14 02:03:28 UTC 2017
I also tried it with 32 bit build on 64 bit machine by a simple c program with " -m32 -Werror -Wcast-align" options, but I can't reproduce this error information. The error message is saying char pointer or uint8 pointer may be any address (non-alignment to 4 or 8 bytes boundary), but struct ofpact_ed_prop pointer aligns to 4 or 8 bytes boundary, our code and variable struct results in that we can hardly handle this.
A way is to remove "-Wcast-align" from ovs compiling option.
-----Original Message-----
From: Ben Pfaff [mailto:blp at ovn.org]
Sent: Friday, July 14, 2017 1:22 AM
To: Zoltán Balogh <zoltan.balogh at ericsson.com>
Cc: 'dev at openvswitch.org' <dev at openvswitch.org>; Jan Scheurich <jan.scheurich at ericsson.com>; Georg Schmuecking <Georg.Schmuecking at ericsson.com>; Jiri Benc (jbenc at redhat.com) <jbenc at redhat.com>; Yang, Yi Y <yi.y.yang at intel.com>
Subject: Re: [PATCH 1/4] Add OF actions for generic encap and decap
On Thu, Jul 13, 2017 at 04:49:09PM +0000, Zoltán Balogh wrote:
> Hello Ben,
>
>
> > GCC says:
> >
> > ../lib/ofp-actions.c:4189:13: error: cast from 'char *' to
> > 'struct ofpact_encap *' increases required alignment from 1 to 4 [-Werror,-Wcast-align]
> > ../lib/ofp-actions.c:4222:16: error: cast from 'const uint8_t *'
> > (aka 'const unsigned char *') to 'const struct ofpact_ed_prop *'
> > increases required alignment from 1 to 2 [-Werror,-Wcast-align]
>
> I cannot see these errors. I've tested with GCC 4.8.4 on Ubuntu 14.04.5 LTS and with GCC 6.3.0 on Ubuntu 17.04.
> Which version of GCC and Linux distro did you use? Did you pass any special args to make or to the configure script?
It might be specific to 32-bit builds, since I build and test on i386.
More information about the dev
mailing list