mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 21:10:12 +01:00
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.
(cherry picked from commit 9ff7ff28fc)
This commit is contained in:
parent
efa1d0e173
commit
9f992dd85e
1 changed files with 1 additions and 1 deletions
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
typedef struct {
|
||||
guint num;
|
||||
const char *cmds[];
|
||||
const char *cmds[16];
|
||||
} DcbExpected;
|
||||
|
||||
static gboolean
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue