util: Fix GCC false-positive warning for CONTAINER_OF.
authorBen Pfaff <blp@nicira.com>
Fri, 7 May 2010 00:04:11 +0000 (17:04 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 7 May 2010 21:47:39 +0000 (14:47 -0700)
commiteea62db5e278c5d9183f35a1fb42cc0fbafa86c0
tree475d03822a97a814f5592ee2bb26450828d62783
parent1dc0c95e782acf9763993b9ea2cf63ebc99a3de2
util: Fix GCC false-positive warning for CONTAINER_OF.

On sparc, GCC would issue the following warning for every use of
CONTAINER_OF:

    warning: cast increases required alignment of target type

This is a false positive: assuming that the data structure that it is
applied to was allocated properly, the use of CONTAINER_OF to reach it is
valid.  And if it was not allocated properly, then code that accesses it
other ways will have trouble too.
lib/util.h