From patchwork Wed Dec 18 18:48:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 36947 Received: (qmail 129977 invoked by alias); 18 Dec 2019 18:48:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 129968 invoked by uid 89); 18 Dec 2019 18:48:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=4910, H*r:100, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Dec 2019 18:48:48 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 629BE56024; Wed, 18 Dec 2019 13:48:47 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id zd+XZaFW2yKS; Wed, 18 Dec 2019 13:48:47 -0500 (EST) Received: from murgatroyd.us.adacore.com (unknown [IPv6:2620:20:4000:100::1001]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 08B1656023; Wed, 18 Dec 2019 13:48:46 -0500 (EST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Fix pthread_setname_np build error Date: Wed, 18 Dec 2019 11:48:44 -0700 Message-Id: <20191218184844.18429-1-tromey@adacore.com> MIME-Version: 1.0 My earlier patch to fix the pthread_setname_np build error on macOS was incorrect. While the macOS man page claims that pthread_setname_np returns void, in it is actually declared returning "int". I knew this earlier, but must have made some mistake when preparing the patch for submission (perhaps when removing the templates?). This patch re-fixes the bug. I'm also applying it to the 9.1 branch. Tested by building on macOS High Sierra. gdb/ChangeLog 2019-12-18 Tom Tromey PR build/25268: * gdbsupport/thread-pool.c (set_thread_name): Expect "int" return type on macOS. Add comment. Change-Id: Ib09da6ac33958a0d843f65df2a528112356e7de6 --- gdb/ChangeLog | 6 ++++++ gdb/gdbsupport/thread-pool.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/gdbsupport/thread-pool.c b/gdb/gdbsupport/thread-pool.c index cd548956951..a8c5fb774d9 100644 --- a/gdb/gdbsupport/thread-pool.c +++ b/gdb/gdbsupport/thread-pool.c @@ -49,8 +49,10 @@ set_thread_name (int (*set_name) (pthread_t, const char *), const char *name) set_name (pthread_self (), name); } +/* The macOS man page says that pthread_setname_np returns "void", but + the headers actually declare it returning "int". */ ATTRIBUTE_UNUSED static void -set_thread_name (void (*set_name) (const char *), const char *name) +set_thread_name (int (*set_name) (const char *), const char *name) { set_name (name); }