netns: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
Subsystems (2)
PATCH 1/1 netns: Replace zero-length array with DECLARE_FLEX_ARRAY() helper
Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new DECLARE_FLEX_ARRAY() helper macro.
This helper allows for flexible-array members in unions.
Signed-off-by Gustavo A. R. Silva <[email protected]>
--- include/net/netns/generic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/netns/generic.h +1 -1
@@ -33,7 +33,7 @@ struct net_generic {struct rcu_head rcu; } s; -void *ptr[0 ]; + DECLARE_FLEX_ARRAY(void *, ptr); }; };
Signature · 1 line
2.34.1
Quoted 11 lines · Gustavo A. R. Silva
Zero-length arrays are deprecated and we are moving towards adopting C99 flexible-array members, instead. So, replace zero-length arrays declarations in anonymous union with the new
DECLARE_FLEX_ARRAY()helper macro.This helper allows for flexible-array members in unions.
Thanks! Yeah, I tripped over this one myself while testing -fstrict-flex-arrays.
Reviewed-by Kees Cook <[email protected]>
Signature · 1 line
Kees Cook