From patchwork Wed Jul 4 04:30:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 28221 Received: (qmail 31504 invoked by alias); 4 Jul 2018 04:31:33 -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 31263 invoked by uid 89); 4 Jul 2018 04:31:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=Hx-languages-length:2357 X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Jul 2018 04:30:54 +0000 Received: from smtp.ebox.ca (smtp.electronicbox.net [96.127.255.82]) by barracuda.ebox.ca with ESMTP id GtrAUIZqlP3bAuFY (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 04 Jul 2018 00:30:35 -0400 (EDT) Received: from simark.lan (unknown [192.222.164.54]) by smtp.ebox.ca (Postfix) with ESMTP id BB216441D64; Wed, 4 Jul 2018 00:30:35 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: tom@tromey.com, Simon Marchi Subject: [PATCH 1/2] darwin: Silence syscall deprecated declaration warning Date: Wed, 4 Jul 2018 00:30:32 -0400 Message-Id: <20180704043033.29212-1-simon.marchi@polymtl.ca> X-IsSubscribed: yes This patch silences this warning: /Users/simark/src/binutils-gdb/gdb/darwin-nat.c:839:10: error: 'syscall' is deprecated: first deprecated in macOS 10.12 - syscall(2) is unsupported; please switch to a supported interface. For SYS_kdebug_trace use kdebug_signpost(). [-Werror,-Wdeprecated-declarations] res = syscall (SYS___pthread_kill, thread->gdb_port, nsignal); ^ /usr/include/unistd.h:745:6: note: 'syscall' has been explicitly marked deprecated here int syscall(int, ...); ^ I guess it would be good to find a non-deprecated alternative for sending that signal to a specific thread, but I have not idea what we could use instead (not sure if plain kill would do the trick). gdb/ChangeLog: * darwin-nat.c (darwin_resume_thread): Silence syscall deprecated declaration warning. --- gdb/darwin-nat.c | 3 +++ include/diagnostics.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 8104de53e7f8..95b89aaae302 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -836,7 +836,10 @@ darwin_resume_thread (struct inferior *inf, darwin_thread_t *thread, { /* Note: ptrace is allowed only if the process is stopped. Directly send the signal to the thread. */ + DIAGNOSTIC_PUSH; + DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS; res = syscall (SYS___pthread_kill, thread->gdb_port, nsignal); + DIAGNOSTIC_POP; inferior_debug (4, _("darwin_resume_thread: kill 0x%x %d: %d\n"), thread->gdb_port, nsignal, res); thread->signaled = 1; diff --git a/include/diagnostics.h b/include/diagnostics.h index 4a674106dc01..34fc01b85bd4 100644 --- a/include/diagnostics.h +++ b/include/diagnostics.h @@ -35,6 +35,8 @@ #if defined (__clang__) /* clang */ # define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move") +# define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS \ + DIAGNOSTIC_IGNORE ("-Wdeprecated-declarations") # define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER \ DIAGNOSTIC_IGNORE ("-Wdeprecated-register") # define DIAGNOSTIC_IGNORE_UNUSED_FUNCTION \ @@ -56,6 +58,10 @@ # define DIAGNOSTIC_IGNORE_SELF_MOVE #endif +#ifndef DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS +# define DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS +#endif + #ifndef DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER # define DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER #endif