summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2022-08-08 14:24:37 +0200
committerEugene Syromyatnikov <evgsyr@gmail.com>2022-08-11 14:34:17 +0200
commit3361fdf80d3e9f56d7cf50ba90c9193f53ea65aa (patch)
treec0c012fbcb50c0675e5edc1a7f5f9c913ad97663
parent07da2c35fd20e1d9af9acd3401f3be7699486b67 (diff)
downloadstrace-3361fdf80d3e9f56d7cf50ba90c9193f53ea65aa.tar.gz
tests: fix ioctl_dm test with new kernel headers
Linux commit v5.19-rc2-1-g94dfc73e7cf4 replaced the zero-length array dm_target_msg.sector field declaration with a flexible-array declaration, which led to the following error when compiled with clang: ../../../tests/ioctl_dm.c:53:25: error: field 'target_msg' with variable sized type 'struct dm_target_msg' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end] struct dm_target_msg target_msg; ^ 1 error generated. Work around it by removing the following field and adjusting the untyped message size. * tests/ioctl_dm.c (struct s): Remove tm.target_string field, adjust string field size.
-rw-r--r--tests/ioctl_dm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/ioctl_dm.c b/tests/ioctl_dm.c
index ed872e738..8b1ef5bd6 100644
--- a/tests/ioctl_dm.c
+++ b/tests/ioctl_dm.c
@@ -51,9 +51,8 @@ static struct s {
} ts;
struct {
struct dm_target_msg target_msg;
- char target_string[256];
} tm;
- char string[256];
+ char string[256 + sizeof(struct dm_target_msg)];
} u;
} s;