* [PATCH][next] platform/chrome: Avoid -Wflex-array-member-not-at-end
@ 2025-05-06 21:14 Gustavo A. R. Silva
2025-05-07 3:09 ` Tzung-Bi Shih
0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2025-05-06 21:14 UTC (permalink / raw)
To: Benson Leung, Tzung-Bi Shih, Guenter Roeck
Cc: chrome-platform, 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 structure. Notice
that `struct cros_ec_command` is a flexible structure --a structure
that contains a flexible-array member.
Fix the following warning:
drivers/platform/chrome/cros_ec_proto_test_util.h:16:32: 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>
---
drivers/platform/chrome/cros_ec_proto_test_util.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/chrome/cros_ec_proto_test_util.h b/drivers/platform/chrome/cros_ec_proto_test_util.h
index 414002271c9c..b17239f052c2 100644
--- a/drivers/platform/chrome/cros_ec_proto_test_util.h
+++ b/drivers/platform/chrome/cros_ec_proto_test_util.h
@@ -13,7 +13,6 @@ struct ec_xfer_mock {
struct kunit *test;
/* input */
- struct cros_ec_command msg;
void *i_data;
/* output */
@@ -21,6 +20,10 @@ struct ec_xfer_mock {
int result;
void *o_data;
u32 o_data_len;
+
+ /* input */
+ /* Must be last -ends in a flexible-array member. */
+ struct cros_ec_command msg;
};
extern int cros_kunit_ec_xfer_mock_default_result;
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH][next] platform/chrome: Avoid -Wflex-array-member-not-at-end
2025-05-06 21:14 [PATCH][next] platform/chrome: Avoid -Wflex-array-member-not-at-end Gustavo A. R. Silva
@ 2025-05-07 3:09 ` Tzung-Bi Shih
0 siblings, 0 replies; 2+ messages in thread
From: Tzung-Bi Shih @ 2025-05-07 3:09 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: Benson Leung, Guenter Roeck, chrome-platform, linux-kernel,
linux-hardening
On Tue, May 06, 2025 at 03:14:01PM -0600, Gustavo A. R. Silva wrote:
> -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 cros_ec_command` is a flexible structure --a structure
> that contains a flexible-array member.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next
[1/1] platform/chrome: Avoid -Wflex-array-member-not-at-end
commit: 3e552ccf405c0dea6339988202a564357249c437
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-07 3:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-06 21:14 [PATCH][next] platform/chrome: Avoid -Wflex-array-member-not-at-end Gustavo A. R. Silva
2025-05-07 3:09 ` Tzung-Bi Shih
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox