From nobody Tue May 3 18:21:26 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7430B1AB74BD; Tue, 3 May 2022 18:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kt7ZZ2qt4z3hm8; Tue, 3 May 2022 18:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651602086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sGJcLk2AJ1Ew+kTHkrIz5T8ivYPXRvrmnNPxt38836I=; b=iGw5LmXP/2SrLcEBmm59kh2siCj/tqEVCiPez6Hko4BKtvhNin5tZMZlOJek9Y/QvyZxit xVCLM+mlD37LhIS4MTUFf/qcaI7t1XkNBQoPAIJ4KBEwc7jXqA03ki39sTyxPfbu3aWhzP plj4TwqbcPaquITzZT9xfFPvPph8v1EwApnxdff7aYN//wSDJ2AmiDwv4dGRtGuiHxQkx/ lKFA8Eu2aQnQ02TeOnHnhFoBlflcXM3q3qbk5bT60E9S1E9Yf7iXsLLnJLoea7VVJCjgVv RtyDS3sLOQdgkZQsD3sbQ1nnMdXtZQ95cQalagUjlQf9hp8gacM7lL7U5/WiQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4137423276; Tue, 3 May 2022 18:21:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 243ILQe8025765; Tue, 3 May 2022 18:21:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 243ILQMv025764; Tue, 3 May 2022 18:21:26 GMT (envelope-from git) Date: Tue, 3 May 2022 18:21:26 GMT Message-Id: <202205031821.243ILQMv025764@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: e5f1a45b2473 - stable/13 - Clean up warnings in pthread tests List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e5f1a45b2473eb0a3284c085f5278fad9908c960 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651602086; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sGJcLk2AJ1Ew+kTHkrIz5T8ivYPXRvrmnNPxt38836I=; b=CeRXzugnThyyxDg9yhMUvF3RZR7SLknAstEajr/9dKMZqnLjTf4ukjwPFinLXbtrM8R/pT wPdkWfaYrfV+39xqXKszxqOuFwdo/TDn9LDSE4kALdC8iwoL0sG6+Y0sxy10Y4XHU0o8+/ wTn1zY9w6s7yAAkoth3NsBmNiFdKiX9VHQFAAc0nSEUjZ7lsXQf83fXtfkpmVqya0Alwwq dHu5wy8oSWyBVaO13oIw1m44COG6OePFKkTVG4yDycMXRMh/4UpAn1Y8k4HR5/MUMRZgMi DSxhg9snDqPynQDX9WN2h4880nqLa3TVU/jgnR12+y0XtFUC3WOKy12OtpDFbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651602086; a=rsa-sha256; cv=none; b=hhQos+sSZAFjOLRTUv5PJJ7AH9reAt8DhAARgNHcyUhFmi/QSf21RJ+Iam6yQyIt+Qcr6R dXlJ/goCqC6J9N0QXRq+fFXgdnMtXsZb1SU7DTg5DVlFiiWVc+ypYV1Pxb/APrako4IBcx RDBle8CnwpxOi8EDEzt3MegspuriRmbYBDqhJ9qJntYTGX8LfX7Iw8S7dC7k19QoIo9gbc DvsqzoOHZI4meEOL9wYMv9lm+Vizph5ozPiFEA3T0hCZfP5e6IIvVlNrxxgeTMILxMBtqo ajlM4H+xg/f0inwDQjVZY2btgQbOZQbZwv5y+z+RA//Rl+p+9AjCIeriyEkbJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e5f1a45b2473eb0a3284c085f5278fad9908c960 commit e5f1a45b2473eb0a3284c085f5278fad9908c960 Author: Ed Maste AuthorDate: 2022-02-16 21:10:45 +0000 Commit: Ed Maste CommitDate: 2022-05-03 18:20:43 +0000 Clean up warnings in pthread tests I intend to move these into lib/libthr/tests/ and connect to kyua. This is a first step to address warnings emitted when building using standard make infrastructure. Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D34306 (cherry picked from commit ef135466f81bc3f203efa77d1eb81132f7646196) (cherry picked from commit 7bfe5e45153b3d214cdb09ced8fccdef02337369) --- tools/regression/pthread/cv_cancel1/cv_cancel1.c | 15 ++++++++------- .../pthread/mutex_isowned_np/mutex_isowned_np.c | 2 +- tools/regression/pthread/unwind/Test.cpp | 6 +++--- tools/regression/pthread/unwind/catch_pthread_exit.cpp | 6 +++--- tools/regression/pthread/unwind/cond_wait_cancel.cpp | 8 ++++---- tools/regression/pthread/unwind/cond_wait_cancel2.cpp | 12 ++++++------ tools/regression/pthread/unwind/sem_wait_cancel.cpp | 6 +++--- tools/regression/pthread/unwind/thread_normal_exit.cpp | 4 ++-- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/tools/regression/pthread/cv_cancel1/cv_cancel1.c b/tools/regression/pthread/cv_cancel1/cv_cancel1.c index 2ae94c5a9f1c..fdc50a866411 100644 --- a/tools/regression/pthread/cv_cancel1/cv_cancel1.c +++ b/tools/regression/pthread/cv_cancel1/cv_cancel1.c @@ -32,14 +32,14 @@ #define NLOOPS 10 -pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; -pthread_cond_t cv = PTHREAD_COND_INITIALIZER; +static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t cv = PTHREAD_COND_INITIALIZER; -int wake; -int stop; +static int wake; +static int stop; -void * -thr_routine(void *arg) +static void * +thr_routine(void *arg __unused) { pthread_mutex_lock(&m); while (wake == 0) @@ -51,7 +51,8 @@ thr_routine(void *arg) return (NULL); } -int main(int argc, char **argv) +int +main(void) { pthread_t td; int i; diff --git a/tools/regression/pthread/mutex_isowned_np/mutex_isowned_np.c b/tools/regression/pthread/mutex_isowned_np/mutex_isowned_np.c index 5c23568c33ac..381921c38a06 100644 --- a/tools/regression/pthread/mutex_isowned_np/mutex_isowned_np.c +++ b/tools/regression/pthread/mutex_isowned_np/mutex_isowned_np.c @@ -46,7 +46,7 @@ thread(void *arg) } int -main(int argc, char *argv[]) +main(void) { pthread_t thr; pthread_mutex_t mtx; diff --git a/tools/regression/pthread/unwind/Test.cpp b/tools/regression/pthread/unwind/Test.cpp index 9322deff621e..46e451c390b6 100644 --- a/tools/regression/pthread/unwind/Test.cpp +++ b/tools/regression/pthread/unwind/Test.cpp @@ -1,7 +1,7 @@ /* $FreeBSD$ */ -int destructed; -int destructed2; +static int destructed; +static int destructed2; class Test { public: @@ -10,7 +10,7 @@ public: }; void -cleanup_handler(void *arg) +cleanup_handler(void *arg __unused) { destructed2 = 1; printf("%s()\n", __func__); diff --git a/tools/regression/pthread/unwind/catch_pthread_exit.cpp b/tools/regression/pthread/unwind/catch_pthread_exit.cpp index 15abc20d1fea..db0e875ccaeb 100644 --- a/tools/regression/pthread/unwind/catch_pthread_exit.cpp +++ b/tools/regression/pthread/unwind/catch_pthread_exit.cpp @@ -5,10 +5,10 @@ #include #include -int caught; +static int caught; -void * -thr_routine(void *arg) +static void * +thr_routine(void *arg __unused) { try { pthread_exit(NULL); diff --git a/tools/regression/pthread/unwind/cond_wait_cancel.cpp b/tools/regression/pthread/unwind/cond_wait_cancel.cpp index 5975e028a5ca..4dfa57746552 100644 --- a/tools/regression/pthread/unwind/cond_wait_cancel.cpp +++ b/tools/regression/pthread/unwind/cond_wait_cancel.cpp @@ -8,11 +8,11 @@ #include "Test.cpp" -pthread_mutex_t mtx; -pthread_cond_t cv; +static pthread_mutex_t mtx; +static pthread_cond_t cv; -void * -thr(void *arg) +static void * +thr(void *arg __unused) { Test t; diff --git a/tools/regression/pthread/unwind/cond_wait_cancel2.cpp b/tools/regression/pthread/unwind/cond_wait_cancel2.cpp index c781068918f1..ba71289fad98 100644 --- a/tools/regression/pthread/unwind/cond_wait_cancel2.cpp +++ b/tools/regression/pthread/unwind/cond_wait_cancel2.cpp @@ -13,10 +13,10 @@ #include "Test.cpp" -pthread_mutex_t mtx; -pthread_cond_t cv; +static pthread_mutex_t mtx; +static pthread_cond_t cv; -void f() +static void f() { Test t; @@ -26,13 +26,13 @@ void f() printf("Bug, thread shouldn't be here.\n"); } -void g() +static void g() { f(); } -void * -thr(void *arg) +static void * +thr(void *arg __unused) { pthread_cleanup_push(cleanup_handler, NULL); g(); diff --git a/tools/regression/pthread/unwind/sem_wait_cancel.cpp b/tools/regression/pthread/unwind/sem_wait_cancel.cpp index 019164cb3166..2086de6037cb 100644 --- a/tools/regression/pthread/unwind/sem_wait_cancel.cpp +++ b/tools/regression/pthread/unwind/sem_wait_cancel.cpp @@ -8,10 +8,10 @@ #include "Test.cpp" -sem_t sem; +static sem_t sem; -void * -thr(void *arg) +static void * +thr(void *arg __unused) { Test t; diff --git a/tools/regression/pthread/unwind/thread_normal_exit.cpp b/tools/regression/pthread/unwind/thread_normal_exit.cpp index faf900e572c4..70768265be70 100644 --- a/tools/regression/pthread/unwind/thread_normal_exit.cpp +++ b/tools/regression/pthread/unwind/thread_normal_exit.cpp @@ -7,8 +7,8 @@ #include "Test.cpp" -void * -thr_routine(void *arg) +static void * +thr_routine(void *arg __unused) { Test test;