dcb: fix test 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.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
typedef struct {
|
||||
guint num;
|
||||
const char *cmds[];
|
||||
const char *cmds[16];
|
||||
} DcbExpected;
|
||||
|
||||
static gboolean
|
||||
|
Reference in New Issue
Block a user