From bee07cebcdda6e7c10c3eca0c86872bde956b550 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Wed, 28 Apr 2021 23:56:47 +0200 Subject: [PATCH 1/6] Fix missing initializer warning in gobject/gtype.c gobject/gtype.c:1103:55: warning: missing field 'value_free' initializer static const GTypeValueTable zero_vtable = { NULL, }; ^ --- gobject/gtype.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gobject/gtype.c b/gobject/gtype.c index 94e23b814..2cdbe7ce4 100644 --- a/gobject/gtype.c +++ b/gobject/gtype.c @@ -1100,7 +1100,8 @@ type_data_make_W (TypeNode *node, vtable = pnode->data->common.value_table; else { - static const GTypeValueTable zero_vtable = { NULL, }; + static const GTypeValueTable zero_vtable = + { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; value_table = &zero_vtable; } From 652a7b7db106e3ca211e4dff4956e64cc421a894 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 29 Apr 2021 08:30:44 +0200 Subject: [PATCH 2/6] Fix missing initializer warnings in gio/tests/socket.c gio/tests/socket.c:505:36: warning: missing field 'size' initializer GOutputVector v[7] = { { NULL, }, }; ^ gio/tests/socket.c:630:37: warning: missing field 'vectors' initializer GOutputMessage m[3] = { { NULL, }, }; ^ gio/tests/socket.c:631:37: warning: missing field 'vectors' initializer GInputMessage im[3] = { { NULL, }, }; ^ gio/tests/socket.c:632:36: warning: missing field 'size' initializer GOutputVector v[7] = { { NULL, }, }; ^ gio/tests/socket.c:633:36: warning: missing field 'size' initializer GInputVector iv[7] = { { NULL, }, }; ^ gio/tests/socket.c:871:32: warning: missing field 'vectors' initializer GInputMessage im = { NULL, }; ^ gio/tests/socket.c:872:31: warning: missing field 'size' initializer GInputVector iv = { NULL, }; ^ --- gio/tests/socket.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gio/tests/socket.c b/gio/tests/socket.c index dd984e2e0..fa96a4087 100644 --- a/gio/tests/socket.c +++ b/gio/tests/socket.c @@ -502,7 +502,7 @@ test_ip_sync (GSocketFamily family) g_assert_cmpstr (testbuf, ==, buf); { - GOutputVector v[7] = { { NULL, }, }; + GOutputVector v[7] = { { NULL, 0 }, }; v[0].buffer = testbuf2 + 0; v[0].size = 3; @@ -627,10 +627,10 @@ test_ip_sync_dgram (GSocketFamily family) g_assert_cmpstr (testbuf, ==, buf); { - GOutputMessage m[3] = { { NULL, }, }; - GInputMessage im[3] = { { NULL, }, }; - GOutputVector v[7] = { { NULL, }, }; - GInputVector iv[7] = { { NULL, }, }; + GOutputMessage m[3] = { { NULL, NULL, 0, 0, NULL, 0 }, }; + GInputMessage im[3] = { { NULL, NULL, 0, 0, 0, NULL, 0 }, }; + GOutputVector v[7] = { { NULL, 0 }, }; + GInputVector iv[7] = { { NULL, 0 }, }; v[0].buffer = testbuf2 + 0; v[0].size = 3; @@ -868,8 +868,8 @@ test_ip_sync_dgram_timeouts (GSocketFamily family) /* Check for timeouts when no server is running. */ { gint64 start_time; - GInputMessage im = { NULL, }; - GInputVector iv = { NULL, }; + GInputMessage im = { NULL, NULL, 0, 0, 0, NULL, 0 }; + GInputVector iv = { NULL, 0 }; guint8 buf[128]; iv.buffer = buf; From aace697d7ef10e518a38237aa7d4233b8b406401 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 29 Apr 2021 13:45:36 +0200 Subject: [PATCH 3/6] Fix missing initializer warning in gio/tests/gdbus-exit-on-close.c gio/tests/gdbus-exit-on-close.c:52:14: warning: missing field 'bug' initializer { NULL } ^ --- gio/tests/gdbus-exit-on-close.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gio/tests/gdbus-exit-on-close.c b/gio/tests/gdbus-exit-on-close.c index 4241fc7a4..1bf0ce7dd 100644 --- a/gio/tests/gdbus-exit-on-close.c +++ b/gio/tests/gdbus-exit-on-close.c @@ -49,7 +49,7 @@ static const TestData cases[] = { { "true", NULL, EXPLICITLY_TRUE, REMOTE }, { "false", NULL, EXPLICITLY_FALSE, REMOTE }, { "we-close", "662100", EXPLICITLY_TRUE, LOCAL }, - { NULL } + { NULL, NULL, 0, 0 } }; static gboolean From a369efd207fd870c771668baad4d9e62a21d2df1 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Thu, 29 Apr 2021 13:48:34 +0200 Subject: [PATCH 4/6] Fix missing initializer warning in tests/slice-threadinit.c tests/slice-threadinit.c:34:30: warning: missing field 'sample' initializer } pages[N_PAGES] = { { NULL, }, }; ^ --- tests/slice-threadinit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/slice-threadinit.c b/tests/slice-threadinit.c index 30b186147..e303aa0b2 100644 --- a/tests/slice-threadinit.c +++ b/tests/slice-threadinit.c @@ -31,7 +31,7 @@ static struct { void *page; void *sample; -} pages[N_PAGES] = { { NULL, }, }; +} pages[N_PAGES] = { { NULL, NULL }, }; static const guint magazine_probes[] = MAGAZINE_PROBES; #define N_MAGAZINE_PROBES G_N_ELEMENTS (magazine_probes) From 2b4bf535f1364276d9e562c1fb02ff8a4c7544fd Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 4 May 2021 09:25:13 +0200 Subject: [PATCH 5/6] Fix discard qualifier warning in glib/tests/atomic.c glib/tests/atomic.c:132:18: warning: passing 'typeof (*(cspp)) *' (aka 'const int *const *') to parameter of type 'const gint **' (aka 'const int **') discards qualifiers g_assert_true (g_atomic_pointer_get (cspp) == csp); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ glib/gatomic.h:117:38: note: expanded from macro 'g_atomic_pointer_get' __atomic_load (gapg_temp_atomic, (&(gapg_temp_newval)), __ATOMIC_SEQ_CST); \ ^~~~~~~~~~~~~~~~~~~~~ --- glib/tests/atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/tests/atomic.c b/glib/tests/atomic.c index 14e6e454e..82d98b2db 100644 --- a/glib/tests/atomic.c +++ b/glib/tests/atomic.c @@ -129,7 +129,7 @@ test_types (void) g_assert_cmpuint (gs, ==, 8); g_assert_cmpint (g_atomic_int_get (csp), ==, s); - g_assert_true (g_atomic_pointer_get (cspp) == csp); + g_assert_true (g_atomic_pointer_get ((const gint **) cspp) == csp); /* repeat, without the macros */ #undef g_atomic_int_set From bf536a5ce27ace53e3d747740b9cd9f25d9dc0e8 Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 4 May 2021 09:34:16 +0200 Subject: [PATCH 6/6] Fix incompatible pointer to integer conversion warning in glib/tests/atomic.c lib/tests/atomic.c:115:9: warning: incompatible pointer to integer conversion passing 'void *' to parameter of type 'gsize' (aka 'unsigned long') res = g_atomic_pointer_compare_and_exchange (&gs, NULL, NULL); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glib/gatomic.h:225:34: note: expanded from macro 'g_atomic_pointer_compare_and_exchange' (newval), FALSE, \ ^~~~~~~~ --- glib/tests/atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/tests/atomic.c b/glib/tests/atomic.c index 82d98b2db..fb8cdcd46 100644 --- a/glib/tests/atomic.c +++ b/glib/tests/atomic.c @@ -112,7 +112,7 @@ test_types (void) vp2 = (gpointer) g_atomic_pointer_get (&gs); gs2 = (gsize) vp2; g_assert_cmpuint (gs2, ==, 0); - res = g_atomic_pointer_compare_and_exchange (&gs, NULL, NULL); + res = g_atomic_pointer_compare_and_exchange (&gs, NULL, (gsize) NULL); g_assert_true (res); g_assert_cmpuint (gs, ==, 0); gs2 = (gsize) g_atomic_pointer_add (&gs, 5);