From: Joe Stringer Date: Fri, 16 Oct 2015 22:31:59 +0000 (-0700) Subject: ofp-actions: Fix build on earlier GCC. X-Git-Tag: v2.5.0~418 X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fovs.git;a=commitdiff_plain;h=c7e69808bdb4beb5df2f69b964d448487e775926 ofp-actions: Fix build on earlier GCC. GCC4.4 gets confused by anonymous fields + flexible fields, complains: lib/ofp-actions.h:510: error: flexible array member in otherwise empty struct lib/ofp-actions.h:512: error: bit-field ‘build_assert_failed’ width not an integer constant lib/ofp-actions.h:514: error: bit-field ‘build_assert_failed’ width not an integer constant Fix the problem by specifying the actions length as zero. Reported-by: Pravin B Shelar Signed-off-by: Joe Stringer Acked-by: Pravin B Shelar --- diff --git a/lib/ofp-actions.h b/lib/ofp-actions.h index 0ad2e3f9f..773b61704 100644 --- a/lib/ofp-actions.h +++ b/lib/ofp-actions.h @@ -507,7 +507,7 @@ struct ofpact_conntrack { CT_MEMBERS; uint8_t pad[OFPACT_ALIGN(sizeof(CT_MEMBERS))]; }; - struct ofpact actions[]; + struct ofpact actions[0]; }; BUILD_ASSERT_DECL(offsetof(struct ofpact_conntrack, actions) % OFPACT_ALIGNTO == 0);