ofp-actions: Make struct ofpact constant size across implementations.
authorBen Pfaff <blp@nicira.com>
Tue, 12 Aug 2014 18:42:56 +0000 (11:42 -0700)
committerBen Pfaff <blp@nicira.com>
Tue, 12 Aug 2014 19:29:48 +0000 (12:29 -0700)
commit80a73e719618d78907c5c7c53aea885a2626c11f
tree26a1ce0ffaa537f62bba1f5ae4a371800a45b024
parente0a42ae29a2883b92ba5ce2150f1db5f22652b66
ofp-actions: Make struct ofpact constant size across implementations.

Before commit c2d936a44fa6 (ofp-actions: Centralize all OpenFlow action
code for maintainability.), struct ofpact was 4 bytes with GCC and Clang,
and 12 bytes with other compilers.  That commit changed struct ofpact so
that it remained 4 bytes with GCC and Clang but shrank to 8 bytes on other
compilers.  An unexpected side effect of that change was that the size
of the pad[] array in struct ofpact_nest shrank to 0 bytes, because that
array padded to a multiple of 8 bytes.  MSVC does not support 0-element
arrays, so this caused a build failure.

This commit fixes the problem by changing struct ofpact so that it is 4
bytes with every compiler.

Reported-by: Alin Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alin Serdean <aserdean@cloudbasesolutions.com>
lib/compiler.h
lib/ofp-actions.h