Skip to content

Commit 63a8bf8

Browse files
GustavoARSilvakuba-moo
authored andcommitted
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. Link: KSPP#193 Link: KSPP#225 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Signed-off-by: Gustavo A. R. Silva <[email protected]> Reviewed-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/YzIvfGXxfjdXmIS3@work Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 578b054 commit 63a8bf8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/netns/generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct net_generic {
3333
struct rcu_head rcu;
3434
} s;
3535

36-
void *ptr[0];
36+
DECLARE_FLEX_ARRAY(void *, ptr);
3737
};
3838
};
3939

0 commit comments

Comments
 (0)