From 505cd5e338ecce610f94d0a2fb3c1fb4d7233f26 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Wed, 4 Sep 2024 15:16:29 +0200 Subject: [PATCH] test-pthread: prevent compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .../repos/libports/src/test/pthread/main.cc:539:76: warning: ‘++’ expression of ‘volatile’-qualified type is deprecated [-Wvolatile] .../repos/libports/src/test/pthread/main.cc:1104:32: warning: ‘test’ may be used uninitialized [-Wmaybe-uninitialized] --- repos/libports/src/test/pthread/main.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repos/libports/src/test/pthread/main.cc b/repos/libports/src/test/pthread/main.cc index bf7a9e406c..0f99d2fbb9 100644 --- a/repos/libports/src/test/pthread/main.cc +++ b/repos/libports/src/test/pthread/main.cc @@ -536,7 +536,7 @@ struct Test_mutex_stress } /* stay in mutex for some time */ - for (unsigned volatile d = 0; d < 30000; ++d) ; + for (unsigned volatile d = 0; d < 30000; ) d = d + 3; if (MUTEX_TYPE == PTHREAD_MUTEX_RECURSIVE) { _unlock(); @@ -1099,7 +1099,7 @@ static bool key_destructor_func_called = false; static void test_tls_data() { - int test; + int test = 0; if (pthread_setspecific(key, &test) != 0) { Genode::error("pthread_setspecific() failed");