From 61ce6d55117d3c446777c882dd6c6a59788d553b Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 31 Dec 2024 12:53:12 +0000 Subject: [PATCH] =?UTF-8?q?tests:=20Initialise=20an=20array=E2=80=99s=20el?= =?UTF-8?q?ements=20to=20NULL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is not strictly necessary, but helps scan-build understand that the `g_thread_join()` calls are not going to use uninitialised `GThread` pointers. It can’t reason that the number of loop iterations on the `g_thread_create()` and `g_thread_join()` loops are identical. Fixes: ``` ../../../glib/tests/mutex.c:271:5: warning: 1st function call argument is an uninitialized value [core.CallAndMessage] 271 | g_thread_join (threads[i]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Signed-off-by: Philip Withnall --- glib/tests/mutex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/tests/mutex.c b/glib/tests/mutex.c index bd484c59e..5a089a099 100644 --- a/glib/tests/mutex.c +++ b/glib/tests/mutex.c @@ -246,7 +246,7 @@ static void test_mutex_perf (gconstpointer data) { const guint n_threads = GPOINTER_TO_UINT (data); - GThread *threads[THREADS]; + GThread *threads[THREADS] = { NULL, }; gint64 start_time; gdouble rate; gint x = -1;