]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
smb: client: Avoid a dozen -Wflex-array-member-not-at-end warnings
authorGustavo A. R. Silva <gustavoars@kernel.org>
Mon, 10 Nov 2025 11:48:55 +0000 (20:48 +0900)
committerSteve French <stfrench@microsoft.com>
Mon, 9 Feb 2026 03:24:42 +0000 (21:24 -0600)
-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 corresponding
structure. Notice that struct smb2_file_all_info is a flexible
structure, this is a structure that contains a flexible-array
member.

Fix the following warnings:

12 fs/smb/client/cached_dir.h:51:35: 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>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cached_dir.h

index 112f70277aa639f2340895a87fc62a165a1fb3a4..19d5592512e4bc6602c6780a68e9174f0e5d0312 100644 (file)
@@ -48,8 +48,10 @@ struct cached_fid {
        struct dentry *dentry;
        struct work_struct put_work;
        struct work_struct close_work;
-       struct smb2_file_all_info file_all_info;
        struct cached_dirents dirents;
+
+       /* Must be last as it ends in a flexible-array member. */
+       struct smb2_file_all_info file_all_info;
 };
 
 /* default MAX_CACHED_FIDS is 16 */