Skip to content

Commit 37e2b57

Browse files
exportfs: 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 array declaration in struct fid with the new DECLARE_FLEX_ARRAY() helper macro. This helper allows for a flexible-array member in a union. Link: KSPP#21 Link: KSPP#193 Link: KSPP#197 Link: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Reviewed-by: Kees Cook <keescook@chromium.org> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
1 parent 88603b6 commit 37e2b57

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/linux/exportfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct fid {
131131
u32 parent_block;
132132
u32 parent_generation;
133133
} udf;
134-
__u32 raw[0];
134+
DECLARE_FLEX_ARRAY(__u32, raw);
135135
};
136136
};
137137

0 commit comments

Comments
 (0)