summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2024-04-04 09:09:48 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2024-04-05 11:40:45 +0200
commit9ff7ff28fc15f0e34f6f30cbed63907f7b39b46f (patch)
treee5c56f09aae4a1674b0b27fc848cdec6b2af9cad
parentd369f5519244b4454b30376d36ed22b6777d7ee5 (diff)
dcb: fix test compilationbg/fix-compilation
GCC 14 with LTO generates the following warning: src/core/tests/test-dcb.c: In function 'test_dcb_cleanup': src/core/tests/test-dcb.c:283:5: error: array subscript _3 is outside array bounds of 'const char *[0:]' [-Werror=array-bounds=] 283 | g_assert_cmpstr(expected.cmds[expected.num], ==, NULL); | ^ src/core/tests/test-dcb.c:14:17: note: while referencing 'cmds' 14 | const char *cmds[]; | ^ src/core/tests/test-dcb.c:261:24: note: defined here 'expected' 261 | static DcbExpected expected = { | ^ Define the commands as a fixed array instead of flexible array member.
-rw-r--r--src/core/tests/test-dcb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/tests/test-dcb.c b/src/core/tests/test-dcb.c
index f85e90f990..33437974d5 100644
--- a/src/core/tests/test-dcb.c
+++ b/src/core/tests/test-dcb.c
@@ -11,7 +11,7 @@
typedef struct {
guint num;
- const char *cmds[];
+ const char *cmds[16];
} DcbExpected;
static gboolean