linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] smb: client: Avoid a dozen -Wflex-array-member-not-at-end warnings
@ 2025-11-10 11:48 Gustavo A. R. Silva
  0 siblings, 0 replies; only message in thread
From: Gustavo A. R. Silva @ 2025-11-10 11:48 UTC (permalink / raw)
  To: Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Tom Talpey, Bharath SM
  Cc: linux-cifs, samba-technical, linux-kernel, Gustavo A. R. Silva,
	linux-hardening

-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>
---
 fs/smb/client/cached_dir.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/smb/client/cached_dir.h b/fs/smb/client/cached_dir.h
index 1e383db7c337..bc70197bbfbd 100644
--- a/fs/smb/client/cached_dir.h
+++ b/fs/smb/client/cached_dir.h
@@ -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 */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-10 11:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-10 11:48 [PATCH][next] smb: client: Avoid a dozen -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).