Skip to content

Commit 9e6901f

Browse files
GustavoARSilvabrauner
authored andcommitted
fs: namespace: Avoid -Wflex-array-member-not-at-end warning
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. Move the conflicting declaration to the end of the structure. Notice that `struct statmount` is a flexible structure --a structure that contains a flexible-array member. Fix the following warning: fs/namespace.c:5329:26: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org> Link: https://lore.kernel.org/r/Z-SZKNdCiAkVJvqm@kspp Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 8de5448 commit 9e6901f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/namespace.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5326,8 +5326,10 @@ struct kstatmount {
53265326
struct mnt_idmap *idmap;
53275327
u64 mask;
53285328
struct path root;
5329-
struct statmount sm;
53305329
struct seq_file seq;
5330+
5331+
/* Must be last --ends in a flexible-array member. */
5332+
struct statmount sm;
53315333
};
53325334

53335335
static u64 mnt_to_attr_flags(struct vfsmount *mnt)

0 commit comments

Comments
 (0)