Fix strict aliasing violations with GCC 4.1 and 4.4.
authorJarno Rajahalme <jrajahalme@nicira.com>
Tue, 5 Aug 2014 20:51:19 +0000 (13:51 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Tue, 5 Aug 2014 20:51:19 +0000 (13:51 -0700)
commit02334943a07e2e9a40e350397192d7793b9962f4
tree38b4f00ded77466d6b88be2c80475ac7d7d51db8
parent43d47da4adc16e2b17840247389c5637534cdf0c
Fix strict aliasing violations with GCC 4.1 and 4.4.

The typical use of struct sockaddr_storage is flagged as a strict
aliasing violation by GCC 4.4.7.  Using an explicit union lets the
compiler know that accessing the same location via different types is
not an error.

GCC 4.1.2 had a similar complaint about a cast of ukey's key_buf to
nlattr.  After this patch there are no further warnings with the
XenServer build, so we could start treating warnings as errors in the
builds.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto/connmgr.c
ofproto/ofproto-dpif-sflow.c
ofproto/ofproto-dpif-upcall.c
vswitchd/bridge.c