Skip to content

Commit 3e552cc

Browse files
GustavoARSilvaTzung-Bi Shih
authored andcommitted
platform/chrome: kunit: Avoid -Wflex-array-member-not-at-end
-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 <[email protected]> Link: https://lore.kernel.org/r/aBp7mZ8kj9w4CKkl@kspp Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent a9635ef commit 3e552cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/platform/chrome/cros_ec_proto_test_util.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@ struct ec_xfer_mock {
1313
struct kunit *test;
1414

1515
/* input */
16-
struct cros_ec_command msg;
1716
void *i_data;
1817

1918
/* output */
2019
int ret;
2120
int result;
2221
void *o_data;
2322
u32 o_data_len;
23+
24+
/* input */
25+
/* Must be last -ends in a flexible-array member. */
26+
struct cros_ec_command msg;
2427
};
2528

2629
extern int cros_kunit_ec_xfer_mock_default_result;

0 commit comments

Comments
 (0)